SimpleName:IDENTIFIER 1481 expected expected

SimpleName:IDENTIFIER 1481 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 1481 testSubgraphAdjacentVerticesAdd testSubgraphAdjacentVerticesAdd

SimpleName:IDENTIFIER 1482 SparseDirectedGraph SparseDirectedGraph

SimpleName:IDENTIFIER 1487 SimpleDirectedEdge SimpleDirectedEdge

SimpleName:IDENTIFIER 1491 assertEquals assertEquals

SimpleName:IDENTIFIER 1492 assertEquals assertEquals

SimpleName:IDENTIFIER 1494 vertices vertices

SimpleName:IDENTIFIER 1494 LinkedHashSet LinkedHashSet

SimpleName:IDENTIFIER 1494 Integer Integer

SimpleName:IDENTIFIER 1496 vertices vertices

for (int i = 0; i < 5; ++i) vertices.add(i);

SimpleName:IDENTIFIER 1498 subgraph subgraph

SimpleName:IDENTIFIER 1498 vertices vertices

SimpleName:IDENTIFIER 1500 adjacent adjacent

SimpleName:IDENTIFIER 1500 subgraph subgraph

SimpleName:IDENTIFIER 1500 getNeighbors getNeighbors

Set<Integer> adjacent = subgraph.getNeighbors(0)

SimpleName:IDENTIFIER 1501 adjacent adjacent

@Test(expected = UnsupportedOperationException.class)
public void testSubgraphAdjacentVerticesAdd() {
    Graph<DirectedEdge> g = new SparseDirectedGraph();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleDirectedEdge(i, j));
    }
    assertEquals((10 * 9) / 2, g.size());
    assertEquals(10, g.order());
    Set<Integer> vertices = new LinkedHashSet<Integer>();
    for (int i = 0; i < 5; ++i) vertices.add(i);
    Graph<DirectedEdge> subgraph = g.subgraph(vertices);
    Set<Integer> adjacent = subgraph.getNeighbors(0);
    adjacent.add(0);
}

package edu.ucla.sspace.graph;

import java.util.*;
import edu.ucla.sspace.util.OpenIntSet;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_SparseDirectedGraphTests {
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 1459 expected expected

SimpleName:IDENTIFIER 1459 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 1459 testSubgraphAdjacentVerticesAdd testSubgraphAdjacentVerticesAdd

SimpleName:IDENTIFIER 1460 SparseWeightedGraph SparseWeightedGraph

SimpleName:IDENTIFIER 1465 SimpleWeightedEdge SimpleWeightedEdge

g.add(new SimpleWeightedEdge(i, j, .5));

SimpleName:IDENTIFIER 1469 assertEquals assertEquals

SimpleName:IDENTIFIER 1470 assertEquals assertEquals

SimpleName:IDENTIFIER 1472 vertices vertices

SimpleName:IDENTIFIER 1472 LinkedHashSet LinkedHashSet

SimpleName:IDENTIFIER 1472 Integer Integer

SimpleName:IDENTIFIER 1474 vertices vertices

for (int i = 0; i < 5; ++i) vertices.add(i);

SimpleName:IDENTIFIER 1476 subgraph subgraph

SimpleName:IDENTIFIER 1476 vertices vertices

SimpleName:IDENTIFIER 1478 adjacent adjacent

SimpleName:IDENTIFIER 1478 subgraph subgraph

SimpleName:IDENTIFIER 1478 getNeighbors getNeighbors

Set<Integer> adjacent = subgraph.getNeighbors(0)

SimpleName:IDENTIFIER 1479 adjacent adjacent

@Test(expected = UnsupportedOperationException.class)
public void testSubgraphAdjacentVerticesAdd() {
    Graph<WeightedEdge> g = new SparseWeightedGraph();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleWeightedEdge(i, j, .5));
    }
    assertEquals((10 * 9) / 2, g.size());
    assertEquals(10, g.order());
    Set<Integer> vertices = new LinkedHashSet<Integer>();
    for (int i = 0; i < 5; ++i) vertices.add(i);
    Graph<WeightedEdge> subgraph = g.subgraph(vertices);
    Set<Integer> adjacent = subgraph.getNeighbors(0);
    adjacent.add(0);
}

package edu.ucla.sspace.graph;

import java.util.*;
import edu.ucla.sspace.util.OpenIntSet;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_SparseWeightedGraphTests {
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 1399 expected expected

SimpleName:IDENTIFIER 1399 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 1399 testSubgraphAdjacentVerticesAdd testSubgraphAdjacentVerticesAdd

SimpleName:IDENTIFIER 1400 SparseUndirectedGraph SparseUndirectedGraph

Graph<Edge> g = new SparseUndirectedGraph()

Graph<Edge> g = new SparseUndirectedGraph();

SimpleName:IDENTIFIER 1405 SimpleEdge SimpleEdge

SimpleName:IDENTIFIER 1409 assertEquals assertEquals

SimpleName:IDENTIFIER 1410 assertEquals assertEquals

SimpleName:IDENTIFIER 1412 vertices vertices

SimpleName:IDENTIFIER 1412 LinkedHashSet LinkedHashSet

SimpleName:IDENTIFIER 1412 Integer Integer

SimpleName:IDENTIFIER 1414 vertices vertices

for (int i = 0; i < 5; ++i) vertices.add(i);

SimpleName:IDENTIFIER 1416 subgraph subgraph

SimpleName:IDENTIFIER 1416 vertices vertices

Graph<Edge> subgraph = g.subgraph(vertices)

Graph<Edge> subgraph = g.subgraph(vertices);

SimpleName:IDENTIFIER 1418 adjacent adjacent

SimpleName:IDENTIFIER 1418 subgraph subgraph

SimpleName:IDENTIFIER 1418 getNeighbors getNeighbors

Set<Integer> adjacent = subgraph.getNeighbors(0)

SimpleName:IDENTIFIER 1419 adjacent adjacent

@Test(expected = UnsupportedOperationException.class)
public void testSubgraphAdjacentVerticesAdd() {
    Graph<Edge> g = new SparseUndirectedGraph();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));
    }
    assertEquals((10 * 9) / 2, g.size());
    assertEquals(10, g.order());
    Set<Integer> vertices = new LinkedHashSet<Integer>();
    for (int i = 0; i < 5; ++i) vertices.add(i);
    Graph<Edge> subgraph = g.subgraph(vertices);
    Set<Integer> adjacent = subgraph.getNeighbors(0);
    adjacent.add(0);
}

package edu.ucla.sspace.graph;

import java.util.*;
import edu.ucla.sspace.util.OpenIntSet;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_SparseUndirectedGraphTests {

    public void testSubgraphWhenVerticesRemovedFromBacking() {
        Graph<Edge> g = new SparseUndirectedGraph();
        for (int i = 0; i < 10; i++) {
            for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));
        }
        assertEquals((10 * 9) / 2, g.size());
        assertEquals(10, g.order());
        Set<Integer> vertices = new LinkedHashSet<Integer>();
        for (int i = 0; i < 5; ++i) vertices.add(i);
        Graph<Edge> subgraph = g.subgraph(vertices);
        g.remove(0);
        assertEquals(4, subgraph.order());
        assertEquals((3 * 4) / 2, subgraph.size());
        g.remove(1);
        assertFalse(subgraph.contains(1));
        g.remove(2);
        assertFalse(subgraph.contains(new SimpleEdge(2, 3)));
    }

    public void testSubgraphVertexIteratorWhenVerticesRemovedFromBacking() {
        Graph<Edge> g = new SparseUndirectedGraph();
        for (int i = 0; i < 10; i++) {
            for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));
        }
        assertEquals((10 * 9) / 2, g.size());
        assertEquals(10, g.order());
        Set<Integer> vertices = new LinkedHashSet<Integer>();
        for (int i = 0; i < 5; ++i) vertices.add(i);
        Graph<Edge> subgraph = g.subgraph(vertices);
        Iterator<Integer> it = subgraph.vertices().iterator();
        g.remove(0);
        int i = 0;
        while (it.hasNext()) assertTrue(0 != it.next());
        assertEquals(4, i);
    }

    public void testSubgraphEdgesWhenVerticesRemovedFromBacking() {
        Graph<Edge> g = new SparseUndirectedGraph();
        for (int i = 0; i < 10; i++) {
            for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));
        }
        assertEquals((10 * 9) / 2, g.size());
        assertEquals(10, g.order());
        Set<Integer> vertices = new LinkedHashSet<Integer>();
        for (int i = 0; i < 5; ++i) vertices.add(i);
        Graph<Edge> subgraph = g.subgraph(vertices);
        Set<Edge> edges = subgraph.edges();
        g.remove(0);
        assertEquals((4 * 3) / 2, edges.size());
        assertFalse(edges.contains(new SimpleEdge(0, 1)));
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 1504 expected expected

SimpleName:IDENTIFIER 1504 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 1504 testSubgraphAdjacentVerticesRemove testSubgraphAdjacentVerticesRemove

SimpleName:IDENTIFIER 1505 SparseDirectedGraph SparseDirectedGraph

SimpleName:IDENTIFIER 1510 SimpleDirectedEdge SimpleDirectedEdge

SimpleName:IDENTIFIER 1514 assertEquals assertEquals

SimpleName:IDENTIFIER 1515 assertEquals assertEquals

SimpleName:IDENTIFIER 1517 vertices vertices

SimpleName:IDENTIFIER 1517 LinkedHashSet LinkedHashSet

SimpleName:IDENTIFIER 1517 Integer Integer

SimpleName:IDENTIFIER 1519 vertices vertices

for (int i = 0; i < 5; ++i) vertices.add(i);

SimpleName:IDENTIFIER 1521 subgraph subgraph

SimpleName:IDENTIFIER 1521 vertices vertices

SimpleName:IDENTIFIER 1523 adjacent adjacent

SimpleName:IDENTIFIER 1523 subgraph subgraph

SimpleName:IDENTIFIER 1523 getNeighbors getNeighbors

SimpleName:IDENTIFIER 1524 adjacent adjacent

SimpleName:IDENTIFIER 1524 remove remove

@Test(expected = UnsupportedOperationException.class)
public void testSubgraphAdjacentVerticesRemove() {
    Graph<DirectedEdge> g = new SparseDirectedGraph();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleDirectedEdge(i, j));
    }
    assertEquals((10 * 9) / 2, g.size());
    assertEquals(10, g.order());
    Set<Integer> vertices = new LinkedHashSet<Integer>();
    for (int i = 0; i < 5; ++i) vertices.add(i);
    Graph<DirectedEdge> subgraph = g.subgraph(vertices);
    Set<Integer> adjacent = subgraph.getNeighbors(0);
    adjacent.remove(0);
}

SimpleName:IDENTIFIER 1482 expected expected

SimpleName:IDENTIFIER 1482 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 1482 testSubgraphAdjacentVerticesRemove testSubgraphAdjacentVerticesRemove

SimpleName:IDENTIFIER 1483 SparseWeightedGraph SparseWeightedGraph

SimpleName:IDENTIFIER 1488 SimpleWeightedEdge SimpleWeightedEdge

g.add(new SimpleWeightedEdge(i, j, .5));

SimpleName:IDENTIFIER 1492 assertEquals assertEquals

SimpleName:IDENTIFIER 1493 assertEquals assertEquals

SimpleName:IDENTIFIER 1495 vertices vertices

SimpleName:IDENTIFIER 1495 LinkedHashSet LinkedHashSet

SimpleName:IDENTIFIER 1495 Integer Integer

SimpleName:IDENTIFIER 1497 vertices vertices

for (int i = 0; i < 5; ++i) vertices.add(i);

SimpleName:IDENTIFIER 1499 subgraph subgraph

SimpleName:IDENTIFIER 1499 vertices vertices

SimpleName:IDENTIFIER 1501 adjacent adjacent

SimpleName:IDENTIFIER 1501 subgraph subgraph

SimpleName:IDENTIFIER 1501 getNeighbors getNeighbors

SimpleName:IDENTIFIER 1502 adjacent adjacent

SimpleName:IDENTIFIER 1502 remove remove

@Test(expected = UnsupportedOperationException.class)
public void testSubgraphAdjacentVerticesRemove() {
    Graph<WeightedEdge> g = new SparseWeightedGraph();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleWeightedEdge(i, j, .5));
    }
    assertEquals((10 * 9) / 2, g.size());
    assertEquals(10, g.order());
    Set<Integer> vertices = new LinkedHashSet<Integer>();
    for (int i = 0; i < 5; ++i) vertices.add(i);
    Graph<WeightedEdge> subgraph = g.subgraph(vertices);
    Set<Integer> adjacent = subgraph.getNeighbors(0);
    adjacent.remove(0);
}

SimpleName:IDENTIFIER 1422 expected expected

SimpleName:IDENTIFIER 1422 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 1422 testSubgraphAdjacentVerticesRemove testSubgraphAdjacentVerticesRemove

SimpleName:IDENTIFIER 1423 SparseUndirectedGraph SparseUndirectedGraph

Graph<Edge> g = new SparseUndirectedGraph()

Graph<Edge> g = new SparseUndirectedGraph();

SimpleName:IDENTIFIER 1428 SimpleEdge SimpleEdge

SimpleName:IDENTIFIER 1432 assertEquals assertEquals

SimpleName:IDENTIFIER 1433 assertEquals assertEquals

SimpleName:IDENTIFIER 1435 vertices vertices

SimpleName:IDENTIFIER 1435 LinkedHashSet LinkedHashSet

SimpleName:IDENTIFIER 1435 Integer Integer

SimpleName:IDENTIFIER 1437 vertices vertices

for (int i = 0; i < 5; ++i) vertices.add(i);

SimpleName:IDENTIFIER 1439 subgraph subgraph

SimpleName:IDENTIFIER 1439 vertices vertices

Graph<Edge> subgraph = g.subgraph(vertices)

Graph<Edge> subgraph = g.subgraph(vertices);

SimpleName:IDENTIFIER 1441 adjacent adjacent

SimpleName:IDENTIFIER 1441 subgraph subgraph

SimpleName:IDENTIFIER 1441 getNeighbors getNeighbors

Set<Integer> adjacent = subgraph.getNeighbors(0)

SimpleName:IDENTIFIER 1442 adjacent adjacent

SimpleName:IDENTIFIER 1442 remove remove

@Test(expected = UnsupportedOperationException.class)
public void testSubgraphAdjacentVerticesRemove() {
    Graph<Edge> g = new SparseUndirectedGraph();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));
    }
    assertEquals((10 * 9) / 2, g.size());
    assertEquals(10, g.order());
    Set<Integer> vertices = new LinkedHashSet<Integer>();
    for (int i = 0; i < 5; ++i) vertices.add(i);
    Graph<Edge> subgraph = g.subgraph(vertices);
    Set<Integer> adjacent = subgraph.getNeighbors(0);
    adjacent.remove(0);
}


SimpleName:IDENTIFIER 1560 expected expected

SimpleName:IDENTIFIER 1560 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 1562 SparseDirectedGraph SparseDirectedGraph

SimpleName:IDENTIFIER 1567 SimpleDirectedEdge SimpleDirectedEdge

SimpleName:IDENTIFIER 1571 assertEquals assertEquals

SimpleName:IDENTIFIER 1572 assertEquals assertEquals

SimpleName:IDENTIFIER 1574 vertices vertices

SimpleName:IDENTIFIER 1574 LinkedHashSet LinkedHashSet

SimpleName:IDENTIFIER 1574 Integer Integer

SimpleName:IDENTIFIER 1576 vertices vertices

for (int i = 0; i < 5; ++i) vertices.add(i);

SimpleName:IDENTIFIER 1578 subgraph subgraph

SimpleName:IDENTIFIER 1578 vertices vertices

SimpleName:IDENTIFIER 1579 vertices vertices

SimpleName:IDENTIFIER 1579 remove remove

SimpleName:IDENTIFIER 1581 adjacent adjacent

SimpleName:IDENTIFIER 1581 subgraph subgraph

SimpleName:IDENTIFIER 1581 getNeighbors getNeighbors

SimpleName:IDENTIFIER 1582 assertEquals assertEquals

SimpleName:IDENTIFIER 1582 vertices vertices

SimpleName:IDENTIFIER 1582 adjacent adjacent

SimpleName:IDENTIFIER 1583 adjacent adjacent

SimpleName:IDENTIFIER 1583 iterator iterator

Iterator<Integer> it = adjacent.iterator()

Iterator<Integer> it = adjacent.iterator();

SimpleName:IDENTIFIER 1584 assertTrue assertTrue

SimpleName:IDENTIFIER 1584 hasNext hasNext

SimpleName:IDENTIFIER 1586 remove remove

@Test(expected = UnsupportedOperationException.class)
public void testSubgraphAdjacentVerticesIteratorRemove() {
    Graph<DirectedEdge> g = new SparseDirectedGraph();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleDirectedEdge(i, j));
    }
    assertEquals((10 * 9) / 2, g.size());
    assertEquals(10, g.order());
    Set<Integer> vertices = new LinkedHashSet<Integer>();
    for (int i = 0; i < 5; ++i) vertices.add(i);
    Graph<DirectedEdge> subgraph = g.subgraph(vertices);
    vertices.remove(0);
    Set<Integer> adjacent = subgraph.getNeighbors(0);
    assertEquals(vertices, adjacent);
    Iterator<Integer> it = adjacent.iterator();
    assertTrue(it.hasNext());
    it.next();
    it.remove();
}

SimpleName:IDENTIFIER 1538 expected expected

SimpleName:IDENTIFIER 1538 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 1540 SparseWeightedGraph SparseWeightedGraph

SimpleName:IDENTIFIER 1545 SimpleWeightedEdge SimpleWeightedEdge

g.add(new SimpleWeightedEdge(i, j, .5));

SimpleName:IDENTIFIER 1549 assertEquals assertEquals

SimpleName:IDENTIFIER 1550 assertEquals assertEquals

SimpleName:IDENTIFIER 1552 vertices vertices

SimpleName:IDENTIFIER 1552 LinkedHashSet LinkedHashSet

SimpleName:IDENTIFIER 1552 Integer Integer

SimpleName:IDENTIFIER 1554 vertices vertices

for (int i = 0; i < 5; ++i) vertices.add(i);

SimpleName:IDENTIFIER 1556 subgraph subgraph

SimpleName:IDENTIFIER 1556 vertices vertices

SimpleName:IDENTIFIER 1557 vertices vertices

SimpleName:IDENTIFIER 1557 remove remove

SimpleName:IDENTIFIER 1559 adjacent adjacent

SimpleName:IDENTIFIER 1559 subgraph subgraph

SimpleName:IDENTIFIER 1559 getNeighbors getNeighbors

SimpleName:IDENTIFIER 1560 assertEquals assertEquals

SimpleName:IDENTIFIER 1560 vertices vertices

SimpleName:IDENTIFIER 1560 adjacent adjacent

SimpleName:IDENTIFIER 1561 adjacent adjacent

SimpleName:IDENTIFIER 1561 iterator iterator

Iterator<Integer> it = adjacent.iterator()

Iterator<Integer> it = adjacent.iterator();

SimpleName:IDENTIFIER 1562 assertTrue assertTrue

SimpleName:IDENTIFIER 1562 hasNext hasNext

SimpleName:IDENTIFIER 1564 remove remove

@Test(expected = UnsupportedOperationException.class)
public void testSubgraphAdjacentVerticesIteratorRemove() {
    Graph<WeightedEdge> g = new SparseWeightedGraph();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleWeightedEdge(i, j, .5));
    }
    assertEquals((10 * 9) / 2, g.size());
    assertEquals(10, g.order());
    Set<Integer> vertices = new LinkedHashSet<Integer>();
    for (int i = 0; i < 5; ++i) vertices.add(i);
    Graph<WeightedEdge> subgraph = g.subgraph(vertices);
    vertices.remove(0);
    Set<Integer> adjacent = subgraph.getNeighbors(0);
    assertEquals(vertices, adjacent);
    Iterator<Integer> it = adjacent.iterator();
    assertTrue(it.hasNext());
    it.next();
    it.remove();
}

SimpleName:IDENTIFIER 1478 expected expected

SimpleName:IDENTIFIER 1478 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 1480 SparseUndirectedGraph SparseUndirectedGraph

Graph<Edge> g = new SparseUndirectedGraph()

Graph<Edge> g = new SparseUndirectedGraph();

SimpleName:IDENTIFIER 1485 SimpleEdge SimpleEdge

SimpleName:IDENTIFIER 1489 assertEquals assertEquals

SimpleName:IDENTIFIER 1490 assertEquals assertEquals

SimpleName:IDENTIFIER 1492 vertices vertices

SimpleName:IDENTIFIER 1492 LinkedHashSet LinkedHashSet

SimpleName:IDENTIFIER 1492 Integer Integer

SimpleName:IDENTIFIER 1494 vertices vertices

for (int i = 0; i < 5; ++i) vertices.add(i);

SimpleName:IDENTIFIER 1496 subgraph subgraph

SimpleName:IDENTIFIER 1496 vertices vertices

Graph<Edge> subgraph = g.subgraph(vertices)

Graph<Edge> subgraph = g.subgraph(vertices);

SimpleName:IDENTIFIER 1497 vertices vertices

SimpleName:IDENTIFIER 1497 remove remove

SimpleName:IDENTIFIER 1499 adjacent adjacent

SimpleName:IDENTIFIER 1499 subgraph subgraph

SimpleName:IDENTIFIER 1499 getNeighbors getNeighbors

Set<Integer> adjacent = subgraph.getNeighbors(0)

SimpleName:IDENTIFIER 1500 assertEquals assertEquals

SimpleName:IDENTIFIER 1500 vertices vertices

SimpleName:IDENTIFIER 1500 adjacent adjacent

SimpleName:IDENTIFIER 1501 adjacent adjacent

SimpleName:IDENTIFIER 1501 iterator iterator

Iterator<Integer> it = adjacent.iterator()

Iterator<Integer> it = adjacent.iterator();

SimpleName:IDENTIFIER 1502 assertTrue assertTrue

SimpleName:IDENTIFIER 1502 hasNext hasNext

SimpleName:IDENTIFIER 1504 remove remove

@Test(expected = UnsupportedOperationException.class)
public void testSubgraphAdjacentVerticesIteratorRemove() {
    Graph<Edge> g = new SparseUndirectedGraph();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));
    }
    assertEquals((10 * 9) / 2, g.size());
    assertEquals(10, g.order());
    Set<Integer> vertices = new LinkedHashSet<Integer>();
    for (int i = 0; i < 5; ++i) vertices.add(i);
    Graph<Edge> subgraph = g.subgraph(vertices);
    vertices.remove(0);
    Set<Integer> adjacent = subgraph.getNeighbors(0);
    assertEquals(vertices, adjacent);
    Iterator<Integer> it = adjacent.iterator();
    assertTrue(it.hasNext());
    it.next();
    it.remove();
}


SimpleName:IDENTIFIER 51 expected expected

SimpleName:IDENTIFIER 51 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 51 testConstructorNonpositive testConstructorNonpositive

SimpleName:IDENTIFIER 52 SparseUndirectedGraph SparseUndirectedGraph

SimpleName:IDENTIFIER 57 SimpleEdge SimpleEdge

SimpleName:IDENTIFIER 60 SubgraphIterator SubgraphIterator

@Test(expected = IllegalArgumentException.class)
public void testConstructorNonpositive() {
    Graph<Edge> g = new SparseUndirectedGraph();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));
    }
    SubgraphIterator<Edge, Graph<Edge>> iter = new SubgraphIterator<Edge, Graph<Edge>>(g, -1);
}

package edu.ucla.sspace.graph;

import java.util.*;
import edu.ucla.sspace.util.OpenIntSet;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_SubgraphIteratorTests {

    private void checkSize(int expectedSize, int subgraphSize, Graph<?> g) {
        @SuppressWarnings("unchecked")
        SubgraphIterator iter = new SubgraphIterator(g, subgraphSize);
        int numSubgraphs = 0;
        while (iter.hasNext()) {
            iter.next();
            numSubgraphs++;
        }
        assertEquals(expectedSize, numSubgraphs);
    }
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 63 expected expected

SimpleName:IDENTIFIER 63 NullPointerException NullPointerException

SimpleName:IDENTIFIER 63 testConstructorNull testConstructorNull

SimpleName:IDENTIFIER 64 SubgraphIterator SubgraphIterator

@Test(expected = NullPointerException.class)
public void testConstructorNull() {
    SubgraphIterator<Edge, Graph<Edge>> iter = new SubgraphIterator<Edge, Graph<Edge>>(null, 10);
}

SimpleName:IDENTIFIER 67 expected expected

SimpleName:IDENTIFIER 67 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 67 testConstructorSizeTooLarge testConstructorSizeTooLarge

SimpleName:IDENTIFIER 68 SparseUndirectedGraph SparseUndirectedGraph

SimpleName:IDENTIFIER 73 SimpleEdge SimpleEdge

SimpleName:IDENTIFIER 76 SubgraphIterator SubgraphIterator

@Test(expected = IllegalArgumentException.class)
public void testConstructorSizeTooLarge() {
    Graph<Edge> g = new SparseUndirectedGraph();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));
    }
    SubgraphIterator<Edge, Graph<Edge>> iter = new SubgraphIterator<Edge, Graph<Edge>>(g, 20);
}


SimpleName:IDENTIFIER 51 expected expected

SimpleName:IDENTIFIER 51 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 51 testConstructorNonpositive testConstructorNonpositive

SimpleName:IDENTIFIER 52 SparseUndirectedGraph SparseUndirectedGraph

Graph<Edge> g = new SparseUndirectedGraph()

Graph<Edge> g = new SparseUndirectedGraph();

SimpleName:IDENTIFIER 57 SimpleEdge SimpleEdge

for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));

{
    for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));
}

SimpleName:IDENTIFIER 60 SamplingSubgraphIterator SamplingSubgraphIterator

new SamplingSubgraphIterator<Edge>(g, -1, new double[] { 1, 1, 1 })

@Test(expected = IllegalArgumentException.class)
public void testConstructorNonpositive() {
    Graph<Edge> g = new SparseUndirectedGraph();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));
    }
    SamplingSubgraphIterator<Edge> iter = new SamplingSubgraphIterator<Edge>(g, -1, new double[] { 1, 1, 1 });
}

package edu.ucla.sspace.graph;

import java.util.*;
import edu.ucla.sspace.util.OpenIntSet;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_SamplingSubgraphIteratorTests {
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 63 expected expected

SimpleName:IDENTIFIER 63 NullPointerException NullPointerException

SimpleName:IDENTIFIER 63 testConstructorNull testConstructorNull

SimpleName:IDENTIFIER 64 SamplingSubgraphIterator SamplingSubgraphIterator

new SamplingSubgraphIterator<Edge>(null, 10, new double[] { 1, 1, 1 })

@Test(expected = NullPointerException.class)
public void testConstructorNull() {
    SamplingSubgraphIterator<Edge> iter = new SamplingSubgraphIterator<Edge>(null, 10, new double[] { 1, 1, 1 });
}

SimpleName:IDENTIFIER 67 expected expected

SimpleName:IDENTIFIER 67 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 67 testConstructorSizeTooLarge testConstructorSizeTooLarge

SimpleName:IDENTIFIER 68 SparseUndirectedGraph SparseUndirectedGraph

Graph<Edge> g = new SparseUndirectedGraph()

Graph<Edge> g = new SparseUndirectedGraph();

SimpleName:IDENTIFIER 73 SimpleEdge SimpleEdge

for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));

{
    for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));
}

SimpleName:IDENTIFIER 76 SamplingSubgraphIterator SamplingSubgraphIterator

new SamplingSubgraphIterator<Edge>(g, 20, new double[] { 1, 1, 1 })

@Test(expected = IllegalArgumentException.class)
public void testConstructorSizeTooLarge() {
    Graph<Edge> g = new SparseUndirectedGraph();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));
    }
    SamplingSubgraphIterator<Edge> iter = new SamplingSubgraphIterator<Edge>(g, 20, new double[] { 1, 1, 1 });
}

SimpleName:IDENTIFIER 79 expected expected

SimpleName:IDENTIFIER 79 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 79 testConstructorNegativeProbs testConstructorNegativeProbs

SimpleName:IDENTIFIER 80 SparseUndirectedGraph SparseUndirectedGraph

Graph<Edge> g = new SparseUndirectedGraph()

Graph<Edge> g = new SparseUndirectedGraph();

SimpleName:IDENTIFIER 85 SimpleEdge SimpleEdge

for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));

{
    for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));
}

SimpleName:IDENTIFIER 88 SamplingSubgraphIterator SamplingSubgraphIterator

new SamplingSubgraphIterator<Edge>(g, 3, new double[] { -1, 1, 1 })

@Test(expected = IllegalArgumentException.class)
public void testConstructorNegativeProbs() {
    Graph<Edge> g = new SparseUndirectedGraph();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));
    }
    SamplingSubgraphIterator<Edge> iter = new SamplingSubgraphIterator<Edge>(g, 3, new double[] { -1, 1, 1 });
}

SimpleName:IDENTIFIER 91 expected expected

SimpleName:IDENTIFIER 91 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 91 testConstructorTooLargeProbs testConstructorTooLargeProbs

SimpleName:IDENTIFIER 92 SparseUndirectedGraph SparseUndirectedGraph

Graph<Edge> g = new SparseUndirectedGraph()

Graph<Edge> g = new SparseUndirectedGraph();

SimpleName:IDENTIFIER 97 SimpleEdge SimpleEdge

for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));

{
    for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));
}

SimpleName:IDENTIFIER 100 SamplingSubgraphIterator SamplingSubgraphIterator

new SamplingSubgraphIterator<Edge>(g, 3, new double[] { 2, 1, 1 })

@Test(expected = IllegalArgumentException.class)
public void testConstructorTooLargeProbs() {
    Graph<Edge> g = new SparseUndirectedGraph();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));
    }
    SamplingSubgraphIterator<Edge> iter = new SamplingSubgraphIterator<Edge>(g, 3, new double[] { 2, 1, 1 });
}

SimpleName:IDENTIFIER 103 expected expected

SimpleName:IDENTIFIER 103 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 103 testConstructorWrongNumberOfProbs testConstructorWrongNumberOfProbs

SimpleName:IDENTIFIER 104 SparseUndirectedGraph SparseUndirectedGraph

Graph<Edge> g = new SparseUndirectedGraph()

Graph<Edge> g = new SparseUndirectedGraph();

SimpleName:IDENTIFIER 109 SimpleEdge SimpleEdge

for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));

{
    for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));
}

SimpleName:IDENTIFIER 112 SamplingSubgraphIterator SamplingSubgraphIterator

new SamplingSubgraphIterator<Edge>(g, 3, new double[] { 1, 1, 1, 1 })

@Test(expected = IllegalArgumentException.class)
public void testConstructorWrongNumberOfProbs() {
    Graph<Edge> g = new SparseUndirectedGraph();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));
    }
    SamplingSubgraphIterator<Edge> iter = new SamplingSubgraphIterator<Edge>(g, 3, new double[] { 1, 1, 1, 1 });
}


SimpleName:IDENTIFIER 708 expected expected

SimpleName:IDENTIFIER 708 NoSuchElementException NoSuchElementException

SimpleName:IDENTIFIER 709 testAdjacencyListIteratorNextOffEnd testAdjacencyListIteratorNextOffEnd

SimpleName:IDENTIFIER 710 UndirectedMultigraph UndirectedMultigraph

SimpleName:IDENTIFIER 713 SimpleTypedEdge SimpleTypedEdge

SimpleName:IDENTIFIER 718 HashSet HashSet

SimpleName:IDENTIFIER 718 TypedEdge TypedEdge

SimpleName:IDENTIFIER 719 adjacencyList adjacencyList

SimpleName:IDENTIFIER 719 getAdjacencyList getAdjacencyList

SimpleName:IDENTIFIER 720 assertEquals assertEquals

SimpleName:IDENTIFIER 720 adjacencyList adjacencyList

SimpleName:IDENTIFIER 722 adjacencyList adjacencyList

SimpleName:IDENTIFIER 722 iterator iterator

SimpleName:IDENTIFIER 724 hasNext hasNext

SimpleName:IDENTIFIER 725 assertTrue assertTrue

SimpleName:IDENTIFIER 726 assertEquals assertEquals

@Test(expected = NoSuchElementException.class)
public void testAdjacencyListIteratorNextOffEnd() {
    UndirectedMultigraph<String> g = new UndirectedMultigraph<String>();
    for (int i = 0; i < 10; ++i) {
        for (int j = i + 1; j < 10; ++j) {
            TypedEdge<String> e = new SimpleTypedEdge<String>("type-1", i, j);
            g.add(e);
        }
    }
    Set<TypedEdge<String>> test = new HashSet<TypedEdge<String>>();
    Set<TypedEdge<String>> adjacencyList = g.getAdjacencyList(0);
    assertEquals(9, adjacencyList.size());
    Iterator<TypedEdge<String>> it = adjacencyList.iterator();
    int i = 0;
    while (it.hasNext()) assertTrue(test.add(it.next()));
    assertEquals(9, test.size());
    it.next();
}

package edu.ucla.sspace.graph;

import java.util.*;
import edu.ucla.sspace.util.OpenIntSet;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_UndirectedMultigraphTests {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 730 expected expected

SimpleName:IDENTIFIER 730 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 730 testAdjacencyListIteratorRemove testAdjacencyListIteratorRemove

SimpleName:IDENTIFIER 731 UndirectedMultigraph UndirectedMultigraph

SimpleName:IDENTIFIER 734 SimpleTypedEdge SimpleTypedEdge

new SimpleTypedEdge<String>("type-1", i, j)

e = new SimpleTypedEdge<String>("type-1", i, j)

SimpleName:IDENTIFIER 739 HashSet HashSet

SimpleName:IDENTIFIER 739 TypedEdge TypedEdge

SimpleName:IDENTIFIER 740 adjacencyList adjacencyList

SimpleName:IDENTIFIER 740 getAdjacencyList getAdjacencyList

SimpleName:IDENTIFIER 741 assertEquals assertEquals

SimpleName:IDENTIFIER 741 adjacencyList adjacencyList

SimpleName:IDENTIFIER 743 adjacencyList adjacencyList

SimpleName:IDENTIFIER 743 iterator iterator

Iterator<TypedEdge<String>> it = adjacencyList.iterator()

SimpleName:IDENTIFIER 744 assertTrue assertTrue

SimpleName:IDENTIFIER 744 hasNext hasNext

SimpleName:IDENTIFIER 747 assertFalse assertFalse

SimpleName:IDENTIFIER 747 adjacencyList adjacencyList

SimpleName:IDENTIFIER 747 contains contains

SimpleName:IDENTIFIER 748 assertEquals assertEquals

SimpleName:IDENTIFIER 748 adjacencyList adjacencyList

SimpleName:IDENTIFIER 749 assertFalse assertFalse

SimpleName:IDENTIFIER 749 contains contains

SimpleName:IDENTIFIER 750 assertEquals assertEquals

assertEquals((10 * 9) / 2 - 1, g.size())

assertEquals((10 * 9) / 2 - 1, g.size());

@Test(expected = UnsupportedOperationException.class)
public void testAdjacencyListIteratorRemove() {
    UndirectedMultigraph<String> g = new UndirectedMultigraph<String>();
    for (int i = 0; i < 10; ++i) {
        for (int j = i + 1; j < 10; ++j) {
            TypedEdge<String> e = new SimpleTypedEdge<String>("type-1", i, j);
            g.add(e);
        }
    }
    Set<TypedEdge<String>> test = new HashSet<TypedEdge<String>>();
    Set<TypedEdge<String>> adjacencyList = g.getAdjacencyList(0);
    assertEquals(9, adjacencyList.size());
    Iterator<TypedEdge<String>> it = adjacencyList.iterator();
    assertTrue(it.hasNext());
    Edge e = it.next();
    it.remove();
    assertFalse(adjacencyList.contains(e));
    assertEquals(8, adjacencyList.size());
    assertFalse(g.contains(e));
    assertEquals((10 * 9) / 2 - 1, g.size());
}

SimpleName:IDENTIFIER 753 expected expected

SimpleName:IDENTIFIER 753 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 754 testAdjacencyListIteratorRemoveFirst testAdjacencyListIteratorRemoveFirst

SimpleName:IDENTIFIER 755 UndirectedMultigraph UndirectedMultigraph

SimpleName:IDENTIFIER 758 SimpleTypedEdge SimpleTypedEdge

new SimpleTypedEdge<String>("type-1", i, j)

e = new SimpleTypedEdge<String>("type-1", i, j)

SimpleName:IDENTIFIER 763 HashSet HashSet

SimpleName:IDENTIFIER 763 TypedEdge TypedEdge

SimpleName:IDENTIFIER 764 adjacencyList adjacencyList

SimpleName:IDENTIFIER 764 getAdjacencyList getAdjacencyList

SimpleName:IDENTIFIER 765 assertEquals assertEquals

SimpleName:IDENTIFIER 765 adjacencyList adjacencyList

SimpleName:IDENTIFIER 767 adjacencyList adjacencyList

SimpleName:IDENTIFIER 767 iterator iterator

Iterator<TypedEdge<String>> it = adjacencyList.iterator()

@Test(expected = UnsupportedOperationException.class)
public void testAdjacencyListIteratorRemoveFirst() {
    UndirectedMultigraph<String> g = new UndirectedMultigraph<String>();
    for (int i = 0; i < 10; ++i) {
        for (int j = i + 1; j < 10; ++j) {
            TypedEdge<String> e = new SimpleTypedEdge<String>("type-1", i, j);
            g.add(e);
        }
    }
    Set<TypedEdge<String>> test = new HashSet<TypedEdge<String>>();
    Set<TypedEdge<String>> adjacencyList = g.getAdjacencyList(0);
    assertEquals(9, adjacencyList.size());
    Iterator<TypedEdge<String>> it = adjacencyList.iterator();
    it.remove();
}

SimpleName:IDENTIFIER 771 expected expected

SimpleName:IDENTIFIER 771 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 772 testAdjacencyListIteratorRemoveTwice testAdjacencyListIteratorRemoveTwice

SimpleName:IDENTIFIER 773 UndirectedMultigraph UndirectedMultigraph

SimpleName:IDENTIFIER 776 SimpleTypedEdge SimpleTypedEdge

new SimpleTypedEdge<String>("type-1", i, j)

e = new SimpleTypedEdge<String>("type-1", i, j)

SimpleName:IDENTIFIER 781 HashSet HashSet

SimpleName:IDENTIFIER 781 TypedEdge TypedEdge

SimpleName:IDENTIFIER 782 adjacencyList adjacencyList

SimpleName:IDENTIFIER 782 getAdjacencyList getAdjacencyList

SimpleName:IDENTIFIER 783 assertEquals assertEquals

SimpleName:IDENTIFIER 783 adjacencyList adjacencyList

SimpleName:IDENTIFIER 785 adjacencyList adjacencyList

SimpleName:IDENTIFIER 785 iterator iterator

Iterator<TypedEdge<String>> it = adjacencyList.iterator()

SimpleName:IDENTIFIER 786 assertTrue assertTrue

SimpleName:IDENTIFIER 786 hasNext hasNext

@Test(expected = UnsupportedOperationException.class)
public void testAdjacencyListIteratorRemoveTwice() {
    UndirectedMultigraph<String> g = new UndirectedMultigraph<String>();
    for (int i = 0; i < 10; ++i) {
        for (int j = i + 1; j < 10; ++j) {
            TypedEdge<String> e = new SimpleTypedEdge<String>("type-1", i, j);
            g.add(e);
        }
    }
    Set<TypedEdge<String>> test = new HashSet<TypedEdge<String>>();
    Set<TypedEdge<String>> adjacencyList = g.getAdjacencyList(0);
    assertEquals(9, adjacencyList.size());
    Iterator<TypedEdge<String>> it = adjacencyList.iterator();
    assertTrue(it.hasNext());
    it.next();
    it.remove();
    it.remove();
}


SimpleName:IDENTIFIER 1003 expected expected

SimpleName:IDENTIFIER 1003 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 1003 testSubgraphAddEdgeNewVertex testSubgraphAddEdgeNewVertex

SimpleName:IDENTIFIER 1004 UndirectedMultigraph UndirectedMultigraph

SimpleName:IDENTIFIER 1004 String String

SimpleName:IDENTIFIER 1009 SimpleTypedEdge SimpleTypedEdge

SimpleName:IDENTIFIER 1009 String String

SimpleName:IDENTIFIER 1013 assertEquals assertEquals

SimpleName:IDENTIFIER 1014 assertEquals assertEquals

SimpleName:IDENTIFIER 1016 vertices vertices

SimpleName:IDENTIFIER 1016 LinkedHashSet LinkedHashSet

SimpleName:IDENTIFIER 1016 Integer Integer

SimpleName:IDENTIFIER 1018 vertices vertices

SimpleName:IDENTIFIER 1020 subgraph subgraph

SimpleName:IDENTIFIER 1020 vertices vertices

SimpleName:IDENTIFIER 1021 assertEquals assertEquals

SimpleName:IDENTIFIER 1021 subgraph subgraph

SimpleName:IDENTIFIER 1022 assertEquals assertEquals

SimpleName:IDENTIFIER 1022 subgraph subgraph

SimpleName:IDENTIFIER 1025 assertTrue assertTrue

SimpleName:IDENTIFIER 1025 subgraph subgraph

SimpleName:IDENTIFIER 1025 SimpleTypedEdge SimpleTypedEdge

SimpleName:IDENTIFIER 1025 String String

SimpleName:IDENTIFIER 1026 assertEquals assertEquals

SimpleName:IDENTIFIER 1026 subgraph subgraph

SimpleName:IDENTIFIER 1027 assertEquals assertEquals

SimpleName:IDENTIFIER 1027 subgraph subgraph

SimpleName:IDENTIFIER 1028 assertEquals assertEquals

SimpleName:IDENTIFIER 1029 assertEquals assertEquals

@Test(expected = UnsupportedOperationException.class)
public void testSubgraphAddEdgeNewVertex() {
    UndirectedMultigraph<String> g = new UndirectedMultigraph<String>();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleTypedEdge<String>("type-1", i, j));
    }
    assertEquals((10 * 9) / 2, g.size());
    assertEquals(10, g.order());
    Set<Integer> vertices = new LinkedHashSet<Integer>();
    for (int i = 0; i < 5; ++i) vertices.add(i);
    Multigraph<String, TypedEdge<String>> subgraph = g.subgraph(vertices);
    assertEquals(5, subgraph.order());
    assertEquals((5 * 4) / 2, subgraph.size());
    assertTrue(subgraph.add(new SimpleTypedEdge<String>("type-1", 0, 5)));
    assertEquals((5 * 4) / 2 + 1, subgraph.size());
    assertEquals(6, subgraph.order());
    assertEquals(11, g.order());
    assertEquals((9 * 10) / 2 + 1, g.size());
}


SimpleName:IDENTIFIER 1415 expected expected

SimpleName:IDENTIFIER 1415 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 1415 testSubgraphAdjacentVerticesAdd testSubgraphAdjacentVerticesAdd

SimpleName:IDENTIFIER 1416 UndirectedMultigraph UndirectedMultigraph

SimpleName:IDENTIFIER 1416 String String

SimpleName:IDENTIFIER 1421 SimpleTypedEdge SimpleTypedEdge

SimpleName:IDENTIFIER 1421 String String

SimpleName:IDENTIFIER 1425 assertEquals assertEquals

SimpleName:IDENTIFIER 1426 assertEquals assertEquals

SimpleName:IDENTIFIER 1428 vertices vertices

SimpleName:IDENTIFIER 1428 LinkedHashSet LinkedHashSet

SimpleName:IDENTIFIER 1428 Integer Integer

SimpleName:IDENTIFIER 1430 vertices vertices

SimpleName:IDENTIFIER 1432 subgraph subgraph

SimpleName:IDENTIFIER 1432 vertices vertices

SimpleName:IDENTIFIER 1434 adjacent adjacent

SimpleName:IDENTIFIER 1434 subgraph subgraph

SimpleName:IDENTIFIER 1434 getNeighbors getNeighbors

SimpleName:IDENTIFIER 1435 adjacent adjacent

@Test(expected = UnsupportedOperationException.class)
public void testSubgraphAdjacentVerticesAdd() {
    UndirectedMultigraph<String> g = new UndirectedMultigraph<String>();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleTypedEdge<String>("type-1", i, j));
    }
    assertEquals((10 * 9) / 2, g.size());
    assertEquals(10, g.order());
    Set<Integer> vertices = new LinkedHashSet<Integer>();
    for (int i = 0; i < 5; ++i) vertices.add(i);
    Multigraph<String, TypedEdge<String>> subgraph = g.subgraph(vertices);
    Set<Integer> adjacent = subgraph.getNeighbors(0);
    adjacent.add(0);
}


SimpleName:IDENTIFIER 1438 expected expected

SimpleName:IDENTIFIER 1438 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 1438 testSubgraphAdjacentVerticesRemove testSubgraphAdjacentVerticesRemove

SimpleName:IDENTIFIER 1439 UndirectedMultigraph UndirectedMultigraph

SimpleName:IDENTIFIER 1439 String String

SimpleName:IDENTIFIER 1444 SimpleTypedEdge SimpleTypedEdge

SimpleName:IDENTIFIER 1444 String String

SimpleName:IDENTIFIER 1448 assertEquals assertEquals

SimpleName:IDENTIFIER 1449 assertEquals assertEquals

SimpleName:IDENTIFIER 1451 vertices vertices

SimpleName:IDENTIFIER 1451 LinkedHashSet LinkedHashSet

SimpleName:IDENTIFIER 1451 Integer Integer

SimpleName:IDENTIFIER 1453 vertices vertices

SimpleName:IDENTIFIER 1455 subgraph subgraph

SimpleName:IDENTIFIER 1455 vertices vertices

SimpleName:IDENTIFIER 1457 adjacent adjacent

SimpleName:IDENTIFIER 1457 subgraph subgraph

SimpleName:IDENTIFIER 1457 getNeighbors getNeighbors

SimpleName:IDENTIFIER 1458 adjacent adjacent

SimpleName:IDENTIFIER 1458 remove remove

@Test(expected = UnsupportedOperationException.class)
public void testSubgraphAdjacentVerticesRemove() {
    UndirectedMultigraph<String> g = new UndirectedMultigraph<String>();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleTypedEdge<String>("type-1", i, j));
    }
    assertEquals((10 * 9) / 2, g.size());
    assertEquals(10, g.order());
    Set<Integer> vertices = new LinkedHashSet<Integer>();
    for (int i = 0; i < 5; ++i) vertices.add(i);
    Multigraph<String, TypedEdge<String>> subgraph = g.subgraph(vertices);
    Set<Integer> adjacent = subgraph.getNeighbors(0);
    adjacent.remove(0);
}


SimpleName:IDENTIFIER 1494 expected expected

SimpleName:IDENTIFIER 1494 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 1496 UndirectedMultigraph UndirectedMultigraph

SimpleName:IDENTIFIER 1496 String String

SimpleName:IDENTIFIER 1501 SimpleTypedEdge SimpleTypedEdge

SimpleName:IDENTIFIER 1501 String String

SimpleName:IDENTIFIER 1505 assertEquals assertEquals

SimpleName:IDENTIFIER 1506 assertEquals assertEquals

SimpleName:IDENTIFIER 1508 vertices vertices

SimpleName:IDENTIFIER 1508 LinkedHashSet LinkedHashSet

SimpleName:IDENTIFIER 1508 Integer Integer

SimpleName:IDENTIFIER 1510 vertices vertices

SimpleName:IDENTIFIER 1512 subgraph subgraph

SimpleName:IDENTIFIER 1512 vertices vertices

SimpleName:IDENTIFIER 1513 vertices vertices

SimpleName:IDENTIFIER 1513 remove remove

SimpleName:IDENTIFIER 1515 adjacent adjacent

SimpleName:IDENTIFIER 1515 subgraph subgraph

SimpleName:IDENTIFIER 1515 getNeighbors getNeighbors

SimpleName:IDENTIFIER 1516 assertEquals assertEquals

SimpleName:IDENTIFIER 1516 vertices vertices

SimpleName:IDENTIFIER 1516 adjacent adjacent

SimpleName:IDENTIFIER 1517 adjacent adjacent

SimpleName:IDENTIFIER 1517 iterator iterator

SimpleName:IDENTIFIER 1518 assertTrue assertTrue

SimpleName:IDENTIFIER 1518 hasNext hasNext

SimpleName:IDENTIFIER 1520 remove remove

@Test(expected = UnsupportedOperationException.class)
public void testSubgraphAdjacentVerticesIteratorRemove() {
    UndirectedMultigraph<String> g = new UndirectedMultigraph<String>();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleTypedEdge<String>("type-1", i, j));
    }
    assertEquals((10 * 9) / 2, g.size());
    assertEquals(10, g.order());
    Set<Integer> vertices = new LinkedHashSet<Integer>();
    for (int i = 0; i < 5; ++i) vertices.add(i);
    Multigraph<String, TypedEdge<String>> subgraph = g.subgraph(vertices);
    vertices.remove(0);
    Set<Integer> adjacent = subgraph.getNeighbors(0);
    assertEquals(vertices, adjacent);
    Iterator<Integer> it = adjacent.iterator();
    assertTrue(it.hasNext());
    it.next();
    it.remove();
}


SimpleName:IDENTIFIER 749 expected expected

SimpleName:IDENTIFIER 749 NoSuchElementException NoSuchElementException

SimpleName:IDENTIFIER 750 testAdjacencyListIteratorNextOffEnd testAdjacencyListIteratorNextOffEnd

SimpleName:IDENTIFIER 751 WeightedDirectedMultigraph WeightedDirectedMultigraph

SimpleName:IDENTIFIER 754 SimpleWeightedDirectedTypedEdge SimpleWeightedDirectedTypedEdge

SimpleName:IDENTIFIER 759 HashSet HashSet

SimpleName:IDENTIFIER 759 WeightedDirectedTypedEdge WeightedDirectedTypedEdge

SimpleName:IDENTIFIER 760 adjacencyList adjacencyList

SimpleName:IDENTIFIER 760 getAdjacencyList getAdjacencyList

SimpleName:IDENTIFIER 761 assertEquals assertEquals

SimpleName:IDENTIFIER 761 adjacencyList adjacencyList

SimpleName:IDENTIFIER 763 adjacencyList adjacencyList

SimpleName:IDENTIFIER 763 iterator iterator

SimpleName:IDENTIFIER 765 hasNext hasNext

SimpleName:IDENTIFIER 766 assertTrue assertTrue

SimpleName:IDENTIFIER 767 assertEquals assertEquals

@Test(expected = NoSuchElementException.class)
public void testAdjacencyListIteratorNextOffEnd() {
    WeightedDirectedMultigraph<String> g = new WeightedDirectedMultigraph<String>();
    for (int i = 0; i < 10; ++i) {
        for (int j = i + 1; j < 10; ++j) {
            WeightedDirectedTypedEdge<String> e = new SimpleWeightedDirectedTypedEdge<String>("type-1", i, j, 1.0);
            g.add(e);
        }
    }
    Set<WeightedDirectedTypedEdge<String>> test = new HashSet<WeightedDirectedTypedEdge<String>>();
    Set<WeightedDirectedTypedEdge<String>> adjacencyList = g.getAdjacencyList(0);
    assertEquals(9, adjacencyList.size());
    Iterator<WeightedDirectedTypedEdge<String>> it = adjacencyList.iterator();
    int i = 0;
    while (it.hasNext()) assertTrue(test.add(it.next()));
    assertEquals(9, test.size());
    it.next();
}

package edu.ucla.sspace.graph;

import java.util.*;
import edu.ucla.sspace.util.OpenIntSet;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_WeightedDirectedMultigraphTest {

    public void testAdjacencyListAddEdge() {
        WeightedDirectedMultigraph<String> g = new WeightedDirectedMultigraph<String>();
        for (int i = 0; i < 10; ++i) for (int j = i + 2; j < 10; ++j) g.add(new SimpleWeightedDirectedTypedEdge<String>("type-1", i, j, 1.0));
        assertEquals((10 * 9) / 2 - 9, g.size());
        Set<WeightedDirectedTypedEdge<String>> adjacencyList = g.getAdjacencyList(0);
        WeightedDirectedTypedEdge<String> e = new SimpleWeightedDirectedTypedEdge<String>("type-1", 0, 1, 1.0);
        assertFalse(adjacencyList.contains(e));
        assertFalse(g.contains(e));
        assertTrue(adjacencyList.add(e));
        assertTrue(g.contains(e));
        assertEquals(9, adjacencyList.size());
        assertEquals((10 * 9) / 2 - 8, g.size());
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 1040 expected expected

SimpleName:IDENTIFIER 1040 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 1040 testSubgraphAddEdgeNewVertex testSubgraphAddEdgeNewVertex

SimpleName:IDENTIFIER 1041 WeightedDirectedMultigraph WeightedDirectedMultigraph

SimpleName:IDENTIFIER 1041 String String

SimpleName:IDENTIFIER 1046 SimpleWeightedDirectedTypedEdge SimpleWeightedDirectedTypedEdge

SimpleName:IDENTIFIER 1046 String String

SimpleName:IDENTIFIER 1050 assertEquals assertEquals

SimpleName:IDENTIFIER 1051 assertEquals assertEquals

SimpleName:IDENTIFIER 1053 vertices vertices

SimpleName:IDENTIFIER 1053 LinkedHashSet LinkedHashSet

SimpleName:IDENTIFIER 1053 Integer Integer

SimpleName:IDENTIFIER 1055 vertices vertices

SimpleName:IDENTIFIER 1057 subgraph subgraph

SimpleName:IDENTIFIER 1057 vertices vertices

SimpleName:IDENTIFIER 1058 assertEquals assertEquals

SimpleName:IDENTIFIER 1058 subgraph subgraph

SimpleName:IDENTIFIER 1059 assertEquals assertEquals

SimpleName:IDENTIFIER 1059 subgraph subgraph

SimpleName:IDENTIFIER 1062 assertTrue assertTrue

SimpleName:IDENTIFIER 1062 subgraph subgraph

SimpleName:IDENTIFIER 1062 SimpleWeightedDirectedTypedEdge SimpleWeightedDirectedTypedEdge

SimpleName:IDENTIFIER 1062 String String

SimpleName:IDENTIFIER 1063 assertEquals assertEquals

SimpleName:IDENTIFIER 1063 subgraph subgraph

SimpleName:IDENTIFIER 1064 assertEquals assertEquals

SimpleName:IDENTIFIER 1064 subgraph subgraph

SimpleName:IDENTIFIER 1065 assertEquals assertEquals

SimpleName:IDENTIFIER 1066 assertEquals assertEquals

@Test(expected = UnsupportedOperationException.class)
public void testSubgraphAddEdgeNewVertex() {
    WeightedDirectedMultigraph<String> g = new WeightedDirectedMultigraph<String>();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleWeightedDirectedTypedEdge<String>("type-1", i, j, 1.0));
    }
    assertEquals((10 * 9) / 2, g.size());
    assertEquals(10, g.order());
    Set<Integer> vertices = new LinkedHashSet<Integer>();
    for (int i = 0; i < 5; ++i) vertices.add(i);
    WeightedDirectedMultigraph<String> subgraph = g.subgraph(vertices);
    assertEquals(5, subgraph.order());
    assertEquals((5 * 4) / 2, subgraph.size());
    assertTrue(subgraph.add(new SimpleWeightedDirectedTypedEdge<String>("type-1", 0, 5, 1.0)));
    assertEquals((5 * 4) / 2 + 1, subgraph.size());
    assertEquals(6, subgraph.order());
    assertEquals(11, g.order());
    assertEquals((9 * 10) / 2 + 1, g.size());
}


SimpleName:IDENTIFIER 1419 expected expected

SimpleName:IDENTIFIER 1419 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 1419 testSubgraphAdjacentVerticesAdd testSubgraphAdjacentVerticesAdd

SimpleName:IDENTIFIER 1420 WeightedDirectedMultigraph WeightedDirectedMultigraph

SimpleName:IDENTIFIER 1420 String String

SimpleName:IDENTIFIER 1425 SimpleWeightedDirectedTypedEdge SimpleWeightedDirectedTypedEdge

SimpleName:IDENTIFIER 1425 String String

SimpleName:IDENTIFIER 1429 assertEquals assertEquals

SimpleName:IDENTIFIER 1430 assertEquals assertEquals

SimpleName:IDENTIFIER 1432 vertices vertices

SimpleName:IDENTIFIER 1432 LinkedHashSet LinkedHashSet

SimpleName:IDENTIFIER 1432 Integer Integer

SimpleName:IDENTIFIER 1434 vertices vertices

SimpleName:IDENTIFIER 1436 subgraph subgraph

SimpleName:IDENTIFIER 1436 vertices vertices

SimpleName:IDENTIFIER 1438 adjacent adjacent

SimpleName:IDENTIFIER 1438 subgraph subgraph

SimpleName:IDENTIFIER 1438 getNeighbors getNeighbors

SimpleName:IDENTIFIER 1439 adjacent adjacent

@Test(expected = UnsupportedOperationException.class)
public void testSubgraphAdjacentVerticesAdd() {
    WeightedDirectedMultigraph<String> g = new WeightedDirectedMultigraph<String>();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleWeightedDirectedTypedEdge<String>("type-1", i, j, 1.0));
    }
    assertEquals((10 * 9) / 2, g.size());
    assertEquals(10, g.order());
    Set<Integer> vertices = new LinkedHashSet<Integer>();
    for (int i = 0; i < 5; ++i) vertices.add(i);
    WeightedDirectedMultigraph<String> subgraph = g.subgraph(vertices);
    Set<Integer> adjacent = subgraph.getNeighbors(0);
    adjacent.add(0);
}


SimpleName:IDENTIFIER 1442 expected expected

SimpleName:IDENTIFIER 1442 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 1442 testSubgraphAdjacentVerticesRemove testSubgraphAdjacentVerticesRemove

SimpleName:IDENTIFIER 1443 WeightedDirectedMultigraph WeightedDirectedMultigraph

SimpleName:IDENTIFIER 1443 String String

SimpleName:IDENTIFIER 1448 SimpleWeightedDirectedTypedEdge SimpleWeightedDirectedTypedEdge

SimpleName:IDENTIFIER 1448 String String

SimpleName:IDENTIFIER 1452 assertEquals assertEquals

SimpleName:IDENTIFIER 1453 assertEquals assertEquals

SimpleName:IDENTIFIER 1455 vertices vertices

SimpleName:IDENTIFIER 1455 LinkedHashSet LinkedHashSet

SimpleName:IDENTIFIER 1455 Integer Integer

SimpleName:IDENTIFIER 1457 vertices vertices

SimpleName:IDENTIFIER 1459 subgraph subgraph

SimpleName:IDENTIFIER 1459 vertices vertices

SimpleName:IDENTIFIER 1461 adjacent adjacent

SimpleName:IDENTIFIER 1461 subgraph subgraph

SimpleName:IDENTIFIER 1461 getNeighbors getNeighbors

SimpleName:IDENTIFIER 1462 adjacent adjacent

SimpleName:IDENTIFIER 1462 remove remove

@Test(expected = UnsupportedOperationException.class)
public void testSubgraphAdjacentVerticesRemove() {
    WeightedDirectedMultigraph<String> g = new WeightedDirectedMultigraph<String>();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleWeightedDirectedTypedEdge<String>("type-1", i, j, 1.0));
    }
    assertEquals((10 * 9) / 2, g.size());
    assertEquals(10, g.order());
    Set<Integer> vertices = new LinkedHashSet<Integer>();
    for (int i = 0; i < 5; ++i) vertices.add(i);
    WeightedDirectedMultigraph<String> subgraph = g.subgraph(vertices);
    Set<Integer> adjacent = subgraph.getNeighbors(0);
    adjacent.remove(0);
}


SimpleName:IDENTIFIER 1498 expected expected

SimpleName:IDENTIFIER 1498 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 1500 WeightedDirectedMultigraph WeightedDirectedMultigraph

SimpleName:IDENTIFIER 1500 String String

SimpleName:IDENTIFIER 1505 SimpleWeightedDirectedTypedEdge SimpleWeightedDirectedTypedEdge

SimpleName:IDENTIFIER 1505 String String

SimpleName:IDENTIFIER 1509 assertEquals assertEquals

SimpleName:IDENTIFIER 1510 assertEquals assertEquals

SimpleName:IDENTIFIER 1512 vertices vertices

SimpleName:IDENTIFIER 1512 LinkedHashSet LinkedHashSet

SimpleName:IDENTIFIER 1512 Integer Integer

SimpleName:IDENTIFIER 1514 vertices vertices

SimpleName:IDENTIFIER 1516 subgraph subgraph

SimpleName:IDENTIFIER 1516 vertices vertices

SimpleName:IDENTIFIER 1517 vertices vertices

SimpleName:IDENTIFIER 1517 remove remove

SimpleName:IDENTIFIER 1519 adjacent adjacent

SimpleName:IDENTIFIER 1519 subgraph subgraph

SimpleName:IDENTIFIER 1519 getNeighbors getNeighbors

SimpleName:IDENTIFIER 1520 assertEquals assertEquals

SimpleName:IDENTIFIER 1520 vertices vertices

SimpleName:IDENTIFIER 1520 adjacent adjacent

SimpleName:IDENTIFIER 1521 adjacent adjacent

SimpleName:IDENTIFIER 1521 iterator iterator

SimpleName:IDENTIFIER 1522 assertTrue assertTrue

SimpleName:IDENTIFIER 1522 hasNext hasNext

SimpleName:IDENTIFIER 1524 remove remove

@Test(expected = UnsupportedOperationException.class)
public void testSubgraphAdjacentVerticesIteratorRemove() {
    WeightedDirectedMultigraph<String> g = new WeightedDirectedMultigraph<String>();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleWeightedDirectedTypedEdge<String>("type-1", i, j, 1.0));
    }
    assertEquals((10 * 9) / 2, g.size());
    assertEquals(10, g.order());
    Set<Integer> vertices = new LinkedHashSet<Integer>();
    for (int i = 0; i < 5; ++i) vertices.add(i);
    WeightedDirectedMultigraph<String> subgraph = g.subgraph(vertices);
    vertices.remove(0);
    Set<Integer> adjacent = subgraph.getNeighbors(0);
    assertEquals(vertices, adjacent);
    Iterator<Integer> it = adjacent.iterator();
    assertTrue(it.hasNext());
    it.next();
    it.remove();
}


SimpleName:IDENTIFIER 746 expected expected

SimpleName:IDENTIFIER 746 NoSuchElementException NoSuchElementException

SimpleName:IDENTIFIER 747 testAdjacencyListIteratorNextOffEnd testAdjacencyListIteratorNextOffEnd

SimpleName:IDENTIFIER 748 DirectedMultigraph DirectedMultigraph

SimpleName:IDENTIFIER 751 SimpleDirectedTypedEdge SimpleDirectedTypedEdge

SimpleName:IDENTIFIER 756 HashSet HashSet

SimpleName:IDENTIFIER 756 DirectedTypedEdge DirectedTypedEdge

SimpleName:IDENTIFIER 757 adjacencyList adjacencyList

SimpleName:IDENTIFIER 757 getAdjacencyList getAdjacencyList

SimpleName:IDENTIFIER 758 assertEquals assertEquals

SimpleName:IDENTIFIER 758 adjacencyList adjacencyList

SimpleName:IDENTIFIER 760 adjacencyList adjacencyList

SimpleName:IDENTIFIER 760 iterator iterator

SimpleName:IDENTIFIER 762 hasNext hasNext

SimpleName:IDENTIFIER 763 assertTrue assertTrue

SimpleName:IDENTIFIER 764 assertEquals assertEquals

@Test(expected = NoSuchElementException.class)
public void testAdjacencyListIteratorNextOffEnd() {
    DirectedMultigraph<String> g = new DirectedMultigraph<String>();
    for (int i = 0; i < 10; ++i) {
        for (int j = i + 1; j < 10; ++j) {
            DirectedTypedEdge<String> e = new SimpleDirectedTypedEdge<String>("type-1", i, j);
            g.add(e);
        }
    }
    Set<DirectedTypedEdge<String>> test = new HashSet<DirectedTypedEdge<String>>();
    Set<DirectedTypedEdge<String>> adjacencyList = g.getAdjacencyList(0);
    assertEquals(9, adjacencyList.size());
    Iterator<DirectedTypedEdge<String>> it = adjacencyList.iterator();
    int i = 0;
    while (it.hasNext()) assertTrue(test.add(it.next()));
    assertEquals(9, test.size());
    it.next();
}

package edu.ucla.sspace.graph;

import java.util.*;
import edu.ucla.sspace.util.OpenIntSet;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_DirectedMultigraphTests {

    public void testAdjacencyListAddEdge() {
        DirectedMultigraph<String> g = new DirectedMultigraph<String>();
        for (int i = 0; i < 10; ++i) for (int j = i + 2; j < 10; ++j) g.add(new SimpleDirectedTypedEdge<String>("type-1", i, j));
        assertEquals((10 * 9) / 2 - 9, g.size());
        Set<DirectedTypedEdge<String>> adjacencyList = g.getAdjacencyList(0);
        DirectedTypedEdge<String> e = new SimpleDirectedTypedEdge<String>("type-1", 0, 1);
        assertFalse(adjacencyList.contains(e));
        assertFalse(g.contains(e));
        assertTrue(adjacencyList.add(e));
        assertTrue(g.contains(e));
        assertEquals(9, adjacencyList.size());
        assertEquals((10 * 9) / 2 - 8, g.size());
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 768 expected expected

SimpleName:IDENTIFIER 768 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 768 testAdjacencyListIteratorRemove testAdjacencyListIteratorRemove

SimpleName:IDENTIFIER 769 DirectedMultigraph DirectedMultigraph

SimpleName:IDENTIFIER 772 SimpleDirectedTypedEdge SimpleDirectedTypedEdge

new SimpleDirectedTypedEdge<String>("type-1", i, j)

e = new SimpleDirectedTypedEdge<String>("type-1", i, j)

SimpleName:IDENTIFIER 777 HashSet HashSet

SimpleName:IDENTIFIER 777 DirectedTypedEdge DirectedTypedEdge

test = new HashSet<DirectedTypedEdge<String>>()

SimpleName:IDENTIFIER 778 adjacencyList adjacencyList

SimpleName:IDENTIFIER 778 getAdjacencyList getAdjacencyList

SimpleName:IDENTIFIER 779 assertEquals assertEquals

SimpleName:IDENTIFIER 779 adjacencyList adjacencyList

SimpleName:IDENTIFIER 781 adjacencyList adjacencyList

SimpleName:IDENTIFIER 781 iterator iterator

SimpleName:IDENTIFIER 782 assertTrue assertTrue

SimpleName:IDENTIFIER 782 hasNext hasNext

SimpleName:IDENTIFIER 785 assertFalse assertFalse

SimpleName:IDENTIFIER 785 adjacencyList adjacencyList

SimpleName:IDENTIFIER 785 contains contains

SimpleName:IDENTIFIER 786 assertEquals assertEquals

SimpleName:IDENTIFIER 786 adjacencyList adjacencyList

SimpleName:IDENTIFIER 787 assertFalse assertFalse

SimpleName:IDENTIFIER 787 contains contains

SimpleName:IDENTIFIER 788 assertEquals assertEquals

assertEquals((10 * 9) / 2 - 1, g.size())

assertEquals((10 * 9) / 2 - 1, g.size());

@Test(expected = UnsupportedOperationException.class)
public void testAdjacencyListIteratorRemove() {
    DirectedMultigraph<String> g = new DirectedMultigraph<String>();
    for (int i = 0; i < 10; ++i) {
        for (int j = i + 1; j < 10; ++j) {
            DirectedTypedEdge<String> e = new SimpleDirectedTypedEdge<String>("type-1", i, j);
            g.add(e);
        }
    }
    Set<DirectedTypedEdge<String>> test = new HashSet<DirectedTypedEdge<String>>();
    Set<DirectedTypedEdge<String>> adjacencyList = g.getAdjacencyList(0);
    assertEquals(9, adjacencyList.size());
    Iterator<DirectedTypedEdge<String>> it = adjacencyList.iterator();
    assertTrue(it.hasNext());
    Edge e = it.next();
    it.remove();
    assertFalse(adjacencyList.contains(e));
    assertEquals(8, adjacencyList.size());
    assertFalse(g.contains(e));
    assertEquals((10 * 9) / 2 - 1, g.size());
}

SimpleName:IDENTIFIER 791 expected expected

SimpleName:IDENTIFIER 791 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 792 testAdjacencyListIteratorRemoveFirst testAdjacencyListIteratorRemoveFirst

SimpleName:IDENTIFIER 793 DirectedMultigraph DirectedMultigraph

SimpleName:IDENTIFIER 796 SimpleDirectedTypedEdge SimpleDirectedTypedEdge

new SimpleDirectedTypedEdge<String>("type-1", i, j)

e = new SimpleDirectedTypedEdge<String>("type-1", i, j)

SimpleName:IDENTIFIER 801 HashSet HashSet

SimpleName:IDENTIFIER 801 DirectedTypedEdge DirectedTypedEdge

test = new HashSet<DirectedTypedEdge<String>>()

SimpleName:IDENTIFIER 802 adjacencyList adjacencyList

SimpleName:IDENTIFIER 802 getAdjacencyList getAdjacencyList

SimpleName:IDENTIFIER 803 assertEquals assertEquals

SimpleName:IDENTIFIER 803 adjacencyList adjacencyList

SimpleName:IDENTIFIER 805 adjacencyList adjacencyList

SimpleName:IDENTIFIER 805 iterator iterator

@Test(expected = UnsupportedOperationException.class)
public void testAdjacencyListIteratorRemoveFirst() {
    DirectedMultigraph<String> g = new DirectedMultigraph<String>();
    for (int i = 0; i < 10; ++i) {
        for (int j = i + 1; j < 10; ++j) {
            DirectedTypedEdge<String> e = new SimpleDirectedTypedEdge<String>("type-1", i, j);
            g.add(e);
        }
    }
    Set<DirectedTypedEdge<String>> test = new HashSet<DirectedTypedEdge<String>>();
    Set<DirectedTypedEdge<String>> adjacencyList = g.getAdjacencyList(0);
    assertEquals(9, adjacencyList.size());
    Iterator<DirectedTypedEdge<String>> it = adjacencyList.iterator();
    it.remove();
}

SimpleName:IDENTIFIER 809 expected expected

SimpleName:IDENTIFIER 809 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 810 testAdjacencyListIteratorRemoveTwice testAdjacencyListIteratorRemoveTwice

SimpleName:IDENTIFIER 811 DirectedMultigraph DirectedMultigraph

DirectedMultigraph<String> g = new DirectedMultigraph<String>()

SimpleName:IDENTIFIER 814 SimpleDirectedTypedEdge SimpleDirectedTypedEdge

new SimpleDirectedTypedEdge<String>("type-1", i, j)

e = new SimpleDirectedTypedEdge<String>("type-1", i, j)

SimpleName:IDENTIFIER 819 HashSet HashSet

SimpleName:IDENTIFIER 819 DirectedTypedEdge DirectedTypedEdge

test = new HashSet<DirectedTypedEdge<String>>()

SimpleName:IDENTIFIER 820 adjacencyList adjacencyList

SimpleName:IDENTIFIER 820 getAdjacencyList getAdjacencyList

SimpleName:IDENTIFIER 821 assertEquals assertEquals

SimpleName:IDENTIFIER 821 adjacencyList adjacencyList

SimpleName:IDENTIFIER 823 adjacencyList adjacencyList

SimpleName:IDENTIFIER 823 iterator iterator

SimpleName:IDENTIFIER 824 assertTrue assertTrue

SimpleName:IDENTIFIER 824 hasNext hasNext

@Test(expected = UnsupportedOperationException.class)
public void testAdjacencyListIteratorRemoveTwice() {
    DirectedMultigraph<String> g = new DirectedMultigraph<String>();
    for (int i = 0; i < 10; ++i) {
        for (int j = i + 1; j < 10; ++j) {
            DirectedTypedEdge<String> e = new SimpleDirectedTypedEdge<String>("type-1", i, j);
            g.add(e);
        }
    }
    Set<DirectedTypedEdge<String>> test = new HashSet<DirectedTypedEdge<String>>();
    Set<DirectedTypedEdge<String>> adjacencyList = g.getAdjacencyList(0);
    assertEquals(9, adjacencyList.size());
    Iterator<DirectedTypedEdge<String>> it = adjacencyList.iterator();
    assertTrue(it.hasNext());
    it.next();
    it.remove();
    it.remove();
}


SimpleName:IDENTIFIER 1041 expected expected

SimpleName:IDENTIFIER 1041 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 1041 testSubgraphAddEdgeNewVertex testSubgraphAddEdgeNewVertex

SimpleName:IDENTIFIER 1042 DirectedMultigraph DirectedMultigraph

SimpleName:IDENTIFIER 1042 String String

SimpleName:IDENTIFIER 1047 SimpleDirectedTypedEdge SimpleDirectedTypedEdge

SimpleName:IDENTIFIER 1047 String String

SimpleName:IDENTIFIER 1051 assertEquals assertEquals

SimpleName:IDENTIFIER 1052 assertEquals assertEquals

SimpleName:IDENTIFIER 1054 vertices vertices

SimpleName:IDENTIFIER 1054 LinkedHashSet LinkedHashSet

SimpleName:IDENTIFIER 1054 Integer Integer

SimpleName:IDENTIFIER 1056 vertices vertices

SimpleName:IDENTIFIER 1058 subgraph subgraph

SimpleName:IDENTIFIER 1058 vertices vertices

SimpleName:IDENTIFIER 1059 assertEquals assertEquals

SimpleName:IDENTIFIER 1059 subgraph subgraph

SimpleName:IDENTIFIER 1060 assertEquals assertEquals

SimpleName:IDENTIFIER 1060 subgraph subgraph

SimpleName:IDENTIFIER 1063 assertTrue assertTrue

SimpleName:IDENTIFIER 1063 subgraph subgraph

SimpleName:IDENTIFIER 1063 SimpleDirectedTypedEdge SimpleDirectedTypedEdge

SimpleName:IDENTIFIER 1063 String String

SimpleName:IDENTIFIER 1064 assertEquals assertEquals

SimpleName:IDENTIFIER 1064 subgraph subgraph

SimpleName:IDENTIFIER 1065 assertEquals assertEquals

SimpleName:IDENTIFIER 1065 subgraph subgraph

SimpleName:IDENTIFIER 1066 assertEquals assertEquals

SimpleName:IDENTIFIER 1067 assertEquals assertEquals

@Test(expected = UnsupportedOperationException.class)
public void testSubgraphAddEdgeNewVertex() {
    DirectedMultigraph<String> g = new DirectedMultigraph<String>();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleDirectedTypedEdge<String>("type-1", i, j));
    }
    assertEquals((10 * 9) / 2, g.size());
    assertEquals(10, g.order());
    Set<Integer> vertices = new LinkedHashSet<Integer>();
    for (int i = 0; i < 5; ++i) vertices.add(i);
    DirectedMultigraph<String> subgraph = g.subgraph(vertices);
    assertEquals(5, subgraph.order());
    assertEquals((5 * 4) / 2, subgraph.size());
    assertTrue(subgraph.add(new SimpleDirectedTypedEdge<String>("type-1", 0, 5)));
    assertEquals((5 * 4) / 2 + 1, subgraph.size());
    assertEquals(6, subgraph.order());
    assertEquals(11, g.order());
    assertEquals((9 * 10) / 2 + 1, g.size());
}


SimpleName:IDENTIFIER 1420 expected expected

SimpleName:IDENTIFIER 1420 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 1420 testSubgraphAdjacentVerticesAdd testSubgraphAdjacentVerticesAdd

SimpleName:IDENTIFIER 1421 DirectedMultigraph DirectedMultigraph

SimpleName:IDENTIFIER 1421 String String

SimpleName:IDENTIFIER 1426 SimpleDirectedTypedEdge SimpleDirectedTypedEdge

SimpleName:IDENTIFIER 1426 String String

SimpleName:IDENTIFIER 1430 assertEquals assertEquals

SimpleName:IDENTIFIER 1431 assertEquals assertEquals

SimpleName:IDENTIFIER 1433 vertices vertices

SimpleName:IDENTIFIER 1433 LinkedHashSet LinkedHashSet

SimpleName:IDENTIFIER 1433 Integer Integer

SimpleName:IDENTIFIER 1435 vertices vertices

SimpleName:IDENTIFIER 1437 subgraph subgraph

SimpleName:IDENTIFIER 1437 vertices vertices

SimpleName:IDENTIFIER 1439 adjacent adjacent

SimpleName:IDENTIFIER 1439 subgraph subgraph

SimpleName:IDENTIFIER 1439 getNeighbors getNeighbors

SimpleName:IDENTIFIER 1440 adjacent adjacent

@Test(expected = UnsupportedOperationException.class)
public void testSubgraphAdjacentVerticesAdd() {
    DirectedMultigraph<String> g = new DirectedMultigraph<String>();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleDirectedTypedEdge<String>("type-1", i, j));
    }
    assertEquals((10 * 9) / 2, g.size());
    assertEquals(10, g.order());
    Set<Integer> vertices = new LinkedHashSet<Integer>();
    for (int i = 0; i < 5; ++i) vertices.add(i);
    DirectedMultigraph<String> subgraph = g.subgraph(vertices);
    Set<Integer> adjacent = subgraph.getNeighbors(0);
    adjacent.add(0);
}


SimpleName:IDENTIFIER 1443 expected expected

SimpleName:IDENTIFIER 1443 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 1443 testSubgraphAdjacentVerticesRemove testSubgraphAdjacentVerticesRemove

SimpleName:IDENTIFIER 1444 DirectedMultigraph DirectedMultigraph

SimpleName:IDENTIFIER 1444 String String

SimpleName:IDENTIFIER 1449 SimpleDirectedTypedEdge SimpleDirectedTypedEdge

SimpleName:IDENTIFIER 1449 String String

SimpleName:IDENTIFIER 1453 assertEquals assertEquals

SimpleName:IDENTIFIER 1454 assertEquals assertEquals

SimpleName:IDENTIFIER 1456 vertices vertices

SimpleName:IDENTIFIER 1456 LinkedHashSet LinkedHashSet

SimpleName:IDENTIFIER 1456 Integer Integer

SimpleName:IDENTIFIER 1458 vertices vertices

SimpleName:IDENTIFIER 1460 subgraph subgraph

SimpleName:IDENTIFIER 1460 vertices vertices

SimpleName:IDENTIFIER 1462 adjacent adjacent

SimpleName:IDENTIFIER 1462 subgraph subgraph

SimpleName:IDENTIFIER 1462 getNeighbors getNeighbors

SimpleName:IDENTIFIER 1463 adjacent adjacent

SimpleName:IDENTIFIER 1463 remove remove

@Test(expected = UnsupportedOperationException.class)
public void testSubgraphAdjacentVerticesRemove() {
    DirectedMultigraph<String> g = new DirectedMultigraph<String>();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleDirectedTypedEdge<String>("type-1", i, j));
    }
    assertEquals((10 * 9) / 2, g.size());
    assertEquals(10, g.order());
    Set<Integer> vertices = new LinkedHashSet<Integer>();
    for (int i = 0; i < 5; ++i) vertices.add(i);
    DirectedMultigraph<String> subgraph = g.subgraph(vertices);
    Set<Integer> adjacent = subgraph.getNeighbors(0);
    adjacent.remove(0);
}


SimpleName:IDENTIFIER 1499 expected expected

SimpleName:IDENTIFIER 1499 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 1501 DirectedMultigraph DirectedMultigraph

SimpleName:IDENTIFIER 1501 String String

SimpleName:IDENTIFIER 1506 SimpleDirectedTypedEdge SimpleDirectedTypedEdge

SimpleName:IDENTIFIER 1506 String String

SimpleName:IDENTIFIER 1510 assertEquals assertEquals

SimpleName:IDENTIFIER 1511 assertEquals assertEquals

SimpleName:IDENTIFIER 1513 vertices vertices

SimpleName:IDENTIFIER 1513 LinkedHashSet LinkedHashSet

SimpleName:IDENTIFIER 1513 Integer Integer

SimpleName:IDENTIFIER 1515 vertices vertices

SimpleName:IDENTIFIER 1517 subgraph subgraph

SimpleName:IDENTIFIER 1517 vertices vertices

SimpleName:IDENTIFIER 1518 vertices vertices

SimpleName:IDENTIFIER 1518 remove remove

SimpleName:IDENTIFIER 1520 adjacent adjacent

SimpleName:IDENTIFIER 1520 subgraph subgraph

SimpleName:IDENTIFIER 1520 getNeighbors getNeighbors

SimpleName:IDENTIFIER 1521 assertEquals assertEquals

SimpleName:IDENTIFIER 1521 vertices vertices

SimpleName:IDENTIFIER 1521 adjacent adjacent

SimpleName:IDENTIFIER 1522 adjacent adjacent

SimpleName:IDENTIFIER 1522 iterator iterator

SimpleName:IDENTIFIER 1523 assertTrue assertTrue

SimpleName:IDENTIFIER 1523 hasNext hasNext

SimpleName:IDENTIFIER 1525 remove remove

@Test(expected = UnsupportedOperationException.class)
public void testSubgraphAdjacentVerticesIteratorRemove() {
    DirectedMultigraph<String> g = new DirectedMultigraph<String>();
    for (int i = 0; i < 10; i++) {
        for (int j = i + 1; j < 10; ++j) g.add(new SimpleDirectedTypedEdge<String>("type-1", i, j));
    }
    assertEquals((10 * 9) / 2, g.size());
    assertEquals(10, g.order());
    Set<Integer> vertices = new LinkedHashSet<Integer>();
    for (int i = 0; i < 5; ++i) vertices.add(i);
    DirectedMultigraph<String> subgraph = g.subgraph(vertices);
    vertices.remove(0);
    Set<Integer> adjacent = subgraph.getNeighbors(0);
    assertEquals(vertices, adjacent);
    Iterator<Integer> it = adjacent.iterator();
    assertTrue(it.hasNext());
    it.next();
    it.remove();
}


SimpleName:IDENTIFIER 78 expected expected

SimpleName:IDENTIFIER 78 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 79 testProcessDocAfterTransform testProcessDocAfterTransform

SimpleName:IDENTIFIER 79 Exception Exception

SimpleName:IDENTIFIER 80 GenericWordSpace GenericWordSpace

SimpleName:IDENTIFIER 82 processDocument processDocument

SimpleName:IDENTIFIER 82 BufferedReader BufferedReader

SimpleName:IDENTIFIER 82 StringReader StringReader

SimpleName:IDENTIFIER 83 processSpace processSpace

SimpleName:IDENTIFIER 83 NoTransform NoTransform

SimpleName:IDENTIFIER 84 processDocument processDocument

SimpleName:IDENTIFIER 84 BufferedReader BufferedReader

SimpleName:IDENTIFIER 84 StringReader StringReader

StringLiteralExpr:LITERAL
84
"in a"
"in a"

@Test(expected = IllegalStateException.class)
public void testProcessDocAfterTransform() throws Exception {
    GenericWordSpace gws = new GenericWordSpace();
    for (String doc : Arrays.asList(docArr)) gws.processDocument(new BufferedReader(new StringReader(doc)));
    gws.processSpace(new NoTransform());
    gws.processDocument(new BufferedReader(new StringReader("in a")));
}

package edu.ucla.sspace.gws;

import edu.ucla.sspace.matrix.*;
import java.io.*;
import java.util.*;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_GenericWordSpaceTest {

    static String[] docArr = new String[] { "shipment of gold damaged in a fire", "delivery of silver arrived in a silver truck", "shipment of gold arrived in a truck" };
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 48 expected expected

SimpleName:IDENTIFIER 48 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 49 removeShortOptionTest removeShortOptionTest

SimpleName:IDENTIFIER 50 options options

SimpleName:IDENTIFIER 50 ArgOptions ArgOptions

SimpleName:IDENTIFIER 51 options options

SimpleName:IDENTIFIER 51 addOption addOption

SimpleName:IDENTIFIER 52 options options

SimpleName:IDENTIFIER 52 removeOption removeOption

SimpleName:IDENTIFIER 54 assertTrue assertTrue

SimpleName:IDENTIFIER 54 options options

SimpleName:IDENTIFIER 54 prettyPrint prettyPrint

SimpleName:IDENTIFIER 54 contains contains

SimpleName:IDENTIFIER 56 testArgs testArgs

StringLiteralExpr:LITERAL 56 "location" "location"

String[] testArgs = { "-v", "location" }

String[] testArgs = { "-v", "location" };

SimpleName:IDENTIFIER 57 options options

SimpleName:IDENTIFIER 57 parseOptions parseOptions

SimpleName:IDENTIFIER 57 testArgs testArgs

SimpleName:IDENTIFIER 58 assertEquals assertEquals

SimpleName:IDENTIFIER 58 options options

SimpleName:IDENTIFIER 58 numPositionalArgs numPositionalArgs

@Test(expected = IllegalArgumentException.class)
public void removeShortOptionTest() {
    ArgOptions options = new ArgOptions();
    options.addOption('v', null, null);
    options.removeOption('v');
    assertTrue(!options.prettyPrint().contains("-v"));
    String[] testArgs = { "-v", "location" };
    options.parseOptions(testArgs);
    assertEquals(2, options.numPositionalArgs());
}

package edu.ucla.sspace.common;

import edu.ucla.sspace.matrix.*;
import edu.ucla.sspace.text.*;
import edu.ucla.sspace.util.*;
import org.junit.*;
import static org.junit.Assert.*;

public class adhoc_ArgOptionsTest {

    public static junit.framework.Test suite() {
        return new junit.framework.JUnit4TestAdapter(adhoc_ArgOptionsTest.class);
    }
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 61 expected expected

SimpleName:IDENTIFIER 61 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 62 removeShortWithLongOptionTest removeShortWithLongOptionTest

SimpleName:IDENTIFIER 63 options options

SimpleName:IDENTIFIER 63 ArgOptions ArgOptions

SimpleName:IDENTIFIER 64 options options

SimpleName:IDENTIFIER 64 addOption addOption

StringLiteralExpr:LITERAL 64 "verbose" "verbose"

SimpleName:IDENTIFIER 65 options options

SimpleName:IDENTIFIER 65 removeOption removeOption

SimpleName:IDENTIFIER 67 assertTrue assertTrue

SimpleName:IDENTIFIER 67 options options

SimpleName:IDENTIFIER 67 prettyPrint prettyPrint

SimpleName:IDENTIFIER 67 contains contains

SimpleName:IDENTIFIER 68 assertTrue assertTrue

SimpleName:IDENTIFIER 68 options options

SimpleName:IDENTIFIER 68 prettyPrint prettyPrint

SimpleName:IDENTIFIER 68 contains contains

StringLiteralExpr:LITERAL 68 "--verbose" "--verbose"

SimpleName:IDENTIFIER 70 testArgs testArgs

StringLiteralExpr:LITERAL 70 "location" "location"

String[] testArgs = { "-v", "location" }

String[] testArgs = { "-v", "location" };

SimpleName:IDENTIFIER 71 options options

SimpleName:IDENTIFIER 71 parseOptions parseOptions

SimpleName:IDENTIFIER 71 testArgs testArgs

@Test(expected = IllegalArgumentException.class)
public void removeShortWithLongOptionTest() {
    ArgOptions options = new ArgOptions();
    options.addOption('v', "verbose", null);
    options.removeOption('v');
    assertTrue(!options.prettyPrint().contains("-v"));
    assertTrue(!options.prettyPrint().contains("--verbose"));
    String[] testArgs = { "-v", "location" };
    options.parseOptions(testArgs);
}

SimpleName:IDENTIFIER 74 expected expected

SimpleName:IDENTIFIER 74 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 75 removeLongOptionTest removeLongOptionTest

SimpleName:IDENTIFIER 76 options options

SimpleName:IDENTIFIER 76 ArgOptions ArgOptions

SimpleName:IDENTIFIER 77 options options

SimpleName:IDENTIFIER 77 addOption addOption

StringLiteralExpr:LITERAL 77 "verbose" "verbose"

SimpleName:IDENTIFIER 78 options options

SimpleName:IDENTIFIER 78 removeOption removeOption

StringLiteralExpr:LITERAL 78 "verbose" "verbose"

SimpleName:IDENTIFIER 80 assertTrue assertTrue

SimpleName:IDENTIFIER 80 options options

SimpleName:IDENTIFIER 80 prettyPrint prettyPrint

SimpleName:IDENTIFIER 80 contains contains

SimpleName:IDENTIFIER 81 assertTrue assertTrue

SimpleName:IDENTIFIER 81 options options

SimpleName:IDENTIFIER 81 prettyPrint prettyPrint

SimpleName:IDENTIFIER 81 contains contains

StringLiteralExpr:LITERAL 81 "--verbose" "--verbose"

SimpleName:IDENTIFIER 83 testArgs testArgs

StringLiteralExpr:LITERAL 83 "location" "location"

String[] testArgs = { "-v", "location" }

String[] testArgs = { "-v", "location" };

SimpleName:IDENTIFIER 84 options options

SimpleName:IDENTIFIER 84 parseOptions parseOptions

SimpleName:IDENTIFIER 84 testArgs testArgs

@Test(expected = IllegalArgumentException.class)
public void removeLongOptionTest() {
    ArgOptions options = new ArgOptions();
    options.addOption('v', "verbose", null);
    options.removeOption("verbose");
    assertTrue(!options.prettyPrint().contains("-v"));
    assertTrue(!options.prettyPrint().contains("--verbose"));
    String[] testArgs = { "-v", "location" };
    options.parseOptions(testArgs);
}


SimpleName:IDENTIFIER 60 expected expected

SimpleName:IDENTIFIER 60 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 61 randomDistWrongSize randomDistWrongSize

SimpleName:IDENTIFIER 62 Statistics Statistics

SimpleName:IDENTIFIER 62 randomDistribution randomDistribution

@Test(expected = IllegalArgumentException.class)
public void randomDistWrongSize() {
    Statistics.randomDistribution(10, 5);
}

package edu.ucla.sspace.common;

import edu.ucla.sspace.matrix.*;
import edu.ucla.sspace.text.*;
import edu.ucla.sspace.util.*;
import edu.ucla.sspace.vector.*;
import java.util.BitSet;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_StatisticsTests {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 129 expected expected

SimpleName:IDENTIFIER 129 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 130 testDoubleVectorImmutable testDoubleVectorImmutable

SimpleName:IDENTIFIER 131 DenseVector DenseVector

SimpleName:IDENTIFIER 132 Vectors Vectors

SimpleName:IDENTIFIER 132 immutable immutable

@Test(expected = UnsupportedOperationException.class)
public void testDoubleVectorImmutable() {
    DoubleVector v = new DenseVector(new double[] { 1, 2, 3, 4, 5 });
    DoubleVector r = Vectors.immutable(v);
    r.set(1, 10);
}

package edu.ucla.sspace.vector;

import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_VectorsTest {
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 143 expected expected

SimpleName:IDENTIFIER 143 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 144 testSparseDoubleVectorImmutable testSparseDoubleVectorImmutable

SimpleName:IDENTIFIER 145 CompactSparseVector CompactSparseVector

SimpleName:IDENTIFIER 147 Vectors Vectors

SimpleName:IDENTIFIER 147 immutable immutable

@Test(expected = UnsupportedOperationException.class)
public void testSparseDoubleVectorImmutable() {
    SparseDoubleVector v = new CompactSparseVector(10);
    v.set(8, 10);
    SparseDoubleVector r = Vectors.immutable(v);
    r.set(1, 10);
}


SimpleName:IDENTIFIER 136 expected expected

SimpleName:IDENTIFIER 136 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 137 testIntegerVectorImmutable testIntegerVectorImmutable

SimpleName:IDENTIFIER 138 DenseIntVector DenseIntVector

SimpleName:IDENTIFIER 139 Vectors Vectors

SimpleName:IDENTIFIER 139 immutable immutable

@Test(expected = UnsupportedOperationException.class)
public void testIntegerVectorImmutable() {
    IntegerVector v = new DenseIntVector(new int[] { 1, 2, 3, 4, 5 });
    IntegerVector r = Vectors.immutable(v);
    r.set(1, 10);
}

SimpleName:IDENTIFIER 151 expected expected

SimpleName:IDENTIFIER 151 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 152 testSparseIntegerVectorImmutable testSparseIntegerVectorImmutable

SimpleName:IDENTIFIER 153 CompactSparseIntegerVector CompactSparseIntegerVector

SimpleName:IDENTIFIER 155 Vectors Vectors

SimpleName:IDENTIFIER 155 immutable immutable

@Test(expected = UnsupportedOperationException.class)
public void testSparseIntegerVectorImmutable() {
    SparseIntegerVector v = new CompactSparseIntegerVector(10);
    v.set(8, 10);
    SparseIntegerVector r = Vectors.immutable(v);
    r.set(1, 10);
}


SimpleName:IDENTIFIER 59 expected expected

SimpleName:IDENTIFIER 59 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 60 testIllegalConstructor testIllegalConstructor

SimpleName:IDENTIFIER 61 SparseIntArray SparseIntArray

@Test(expected = IllegalArgumentException.class)
public void testIllegalConstructor() {
    new SparseIntArray(-1);
}

package edu.ucla.sspace.util;

import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_SparseIntArrayTest {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 217 expected expected

SimpleName:IDENTIFIER 217 NoSuchElementException NoSuchElementException

SimpleName:IDENTIFIER 217 testEmptyIteratorNext testEmptyIteratorNext

SimpleName:IDENTIFIER 218 OpenIntSet OpenIntSet

SimpleName:IDENTIFIER 219 iterator iterator

@Test(expected = NoSuchElementException.class)
public void testEmptyIteratorNext() {
    Set<Integer> test = new OpenIntSet();
    Iterator<Integer> it = test.iterator();
    it.next();
}

package edu.ucla.sspace.util;

import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Random;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_OpenIntSetTest {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 223 expected expected

SimpleName:IDENTIFIER 223 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 223 testEmptyIteratorRemove testEmptyIteratorRemove

SimpleName:IDENTIFIER 224 OpenIntSet OpenIntSet

SimpleName:IDENTIFIER 225 iterator iterator

@Test(expected = IllegalStateException.class)
public void testEmptyIteratorRemove() {
    Set<Integer> test = new OpenIntSet();
    Iterator<Integer> it = test.iterator();
    it.remove();
}

SimpleName:IDENTIFIER 243 expected expected

SimpleName:IDENTIFIER 243 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 243 testEmptyIteratorRemoveTwice testEmptyIteratorRemoveTwice

SimpleName:IDENTIFIER 244 OpenIntSet OpenIntSet

SimpleName:IDENTIFIER 248 iterator iterator

@Test(expected = IllegalStateException.class)
public void testEmptyIteratorRemoveTwice() {
    Set<Integer> test = new OpenIntSet();
    for (int i = 0; i < 10; ++i) {
        test.add(i);
    }
    Iterator<Integer> it = test.iterator();
    it.remove();
    it.remove();
}


SimpleName:IDENTIFIER 187 expected expected

SimpleName:IDENTIFIER 187 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 187 testEmptyIteratorRemove testEmptyIteratorRemove

SimpleName:IDENTIFIER 188 CompactIntSet CompactIntSet

SimpleName:IDENTIFIER 189 iterator iterator

@Test(expected = IllegalStateException.class)
public void testEmptyIteratorRemove() {
    Set<Integer> test = new CompactIntSet();
    Iterator<Integer> it = test.iterator();
    it.remove();
}

package edu.ucla.sspace.util.primitive;

import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Random;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_CompactIntSetTest {
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 207 expected expected

SimpleName:IDENTIFIER 207 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 207 testEmptyIteratorRemoveTwice testEmptyIteratorRemoveTwice

SimpleName:IDENTIFIER 208 CompactIntSet CompactIntSet

SimpleName:IDENTIFIER 212 iterator iterator

@Test(expected = IllegalStateException.class)
public void testEmptyIteratorRemoveTwice() {
    Set<Integer> test = new CompactIntSet();
    for (int i = 0; i < 10; ++i) {
        test.add(i);
    }
    Iterator<Integer> it = test.iterator();
    it.remove();
    it.remove();
}


SimpleName:IDENTIFIER 40 expected expected

SimpleName:IDENTIFIER 40 NullPointerException NullPointerException

SimpleName:IDENTIFIER 40 testCreateNull testCreateNull

SimpleName:IDENTIFIER 41 ArrayMap ArrayMap

@Test(expected = NullPointerException.class)
public void testCreateNull() {
    Map<Integer, String> map = new ArrayMap<String>(null);
}

package edu.ucla.sspace.util;

import java.util.*;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_ArrayMapTest {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 61 expected expected

SimpleName:IDENTIFIER 61 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 61 testPutLessThanZero testPutLessThanZero

SimpleName:IDENTIFIER 62 ArrayMap ArrayMap

StringLiteralExpr:LITERAL 62 "foo" "foo"

StringLiteralExpr:LITERAL 62 "bar" "bar"

StringLiteralExpr:LITERAL 62 "baz" "baz"

StringLiteralExpr:LITERAL 63 "quux" "quux"

@Test(expected = IllegalArgumentException.class)
public void testPutLessThanZero() {
    Map<Integer, String> map = new ArrayMap<String>(new String[] { "foo", "bar", "baz" });
    map.put(-1, "quux");
}

SimpleName:IDENTIFIER 66 expected expected

SimpleName:IDENTIFIER 66 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 66 testPutOutOfBounds testPutOutOfBounds

SimpleName:IDENTIFIER 67 ArrayMap ArrayMap

StringLiteralExpr:LITERAL 67 "foo" "foo"

StringLiteralExpr:LITERAL 67 "bar" "bar"

StringLiteralExpr:LITERAL 67 "baz" "baz"

StringLiteralExpr:LITERAL 68 "quux" "quux"

@Test(expected = IllegalArgumentException.class)
public void testPutOutOfBounds() {
    Map<Integer, String> map = new ArrayMap<String>(new String[] { "foo", "bar", "baz" });
    map.put(3, "quux");
}


SimpleName:IDENTIFIER 59 expected expected

SimpleName:IDENTIFIER 59 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 60 testIllegalConstructor testIllegalConstructor

SimpleName:IDENTIFIER 61 SparseDoubleArray SparseDoubleArray

@Test(expected = IllegalArgumentException.class)
public void testIllegalConstructor() {
    new SparseDoubleArray(-1);
}

package edu.ucla.sspace.util;

import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_SparseDoubleArrayTest {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 82 expected expected

SimpleName:IDENTIFIER 82 NullPointerException NullPointerException

SimpleName:IDENTIFIER 83 testPutNullKey testPutNullKey

SimpleName:IDENTIFIER 84 TrieMap TrieMap

StringLiteralExpr:LITERAL 85 "value" "value"

@Test(expected = NullPointerException.class)
public void testPutNullKey() {
    TrieMap<String> m = new TrieMap<String>();
    m.put(null, "value");
}

package edu.ucla.sspace.util;

import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_TrieMapTest {
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 88 expected expected

SimpleName:IDENTIFIER 88 NullPointerException NullPointerException

SimpleName:IDENTIFIER 89 testPutNullValue testPutNullValue

SimpleName:IDENTIFIER 90 TrieMap TrieMap

StringLiteralExpr:LITERAL 91 "key" "key"

@Test(expected = NullPointerException.class)
public void testPutNullValue() {
    TrieMap<String> m = new TrieMap<String>();
    m.put("key", null);
}


SimpleName:IDENTIFIER 498 expected expected

SimpleName:IDENTIFIER 498 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 499 testIteratorRemoveTwice testIteratorRemoveTwice

SimpleName:IDENTIFIER 501 TrieMap TrieMap

StringLiteralExpr:LITERAL 502 "cat" "cat"

SimpleName:IDENTIFIER 503 assertTrue assertTrue

SimpleName:IDENTIFIER 503 containsKey containsKey

StringLiteralExpr:LITERAL 503 "cat" "cat"

SimpleName:IDENTIFIER 505 iterator iterator

@Test(expected = IllegalStateException.class)
public void testIteratorRemoveTwice() {
    TrieMap<String> m = new TrieMap<String>();
    m.put("cat", "0");
    assertTrue(m.containsKey("cat"));
    Iterator<String> it = m.keySet().iterator();
    it.next();
    it.remove();
    it.remove();
}


SimpleName:IDENTIFIER 39 expected expected

SimpleName:IDENTIFIER 39 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 40 testRemove testRemove

SimpleName:IDENTIFIER 40 Exception Exception

SimpleName:IDENTIFIER 41 getClutoSparseFile getClutoSparseFile

SimpleName:IDENTIFIER 42 ClutoSparseFileIterator ClutoSparseFileIterator

@Test(expected = UnsupportedOperationException.class)
public void testRemove() throws Exception {
    File f = getClutoSparseFile();
    Iterator<MatrixEntry> it = new ClutoSparseFileIterator(f);
    it.remove();
}

package edu.ucla.sspace.matrix;

import java.io.*;
import java.util.*;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_ClutoSparseFileIteratorTests {

    private static final double[][] testMatrix = { { 1.5, 0.0, 2.5 }, { 0.0, 1.1, 3.1 }, { 1.1, 3.3, 4.1 } };

    public static File getClutoSparseFile() throws Exception {
        File f = File.createTempFile("unit-test", ".dat");
        PrintWriter pw = new PrintWriter(f);
        pw.printf("%d %d %d\n", testMatrix.length, testMatrix[0].length, 7);
        for (int r = 0; r < testMatrix.length; ++r) {
            for (int c = 0; c < testMatrix[0].length; ++c) if (testMatrix[r][c] != 0d)
                pw.printf("%d %f ", c + 1, (float) testMatrix[r][c]);
            pw.println();
        }
        pw.close();
        return f;
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 41 getDenseTextFile getDenseTextFile

SimpleName:IDENTIFIER 42 DenseTextFileIterator DenseTextFileIterator

@Test(expected = UnsupportedOperationException.class)
public void testRemove() throws Exception {
    File f = getDenseTextFile();
    Iterator<MatrixEntry> it = new DenseTextFileIterator(f);
    it.remove();
}

package edu.ucla.sspace.matrix;

import java.io.*;
import java.util.*;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_DenseTextFileIteratorTests {

    private static final double[][] testMatrix = { { 1.5, 0.0, 2.5 }, { 0.0, 1.1, 3.1 }, { 1.1, 3.3, 4.1 } };

    public static File getDenseTextFile() throws Exception {
        File f = File.createTempFile("unit-test", ".dat");
        PrintWriter pw = new PrintWriter(f);
        for (int r = 0; r < testMatrix.length; ++r) {
            for (int c = 0; c < testMatrix[0].length; ++c) pw.printf("%f ", (float) testMatrix[r][c]);
            pw.println();
        }
        pw.close();
        return f;
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 63 expected expected

SimpleName:IDENTIFIER 63 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 64 testInvalidSet testInvalidSet

SimpleName:IDENTIFIER 66 DiagonalMatrix DiagonalMatrix

@Test(expected = IllegalArgumentException.class)
public void testInvalidSet() {
    DiagonalMatrix matrix = new DiagonalMatrix(6);
    matrix.set(1, 2, 3);
}

package edu.ucla.sspace.matrix;

import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_DiagonalMatrixTest {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 72 expected expected

SimpleName:IDENTIFIER 72 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 73 testInvalidSparseListMatrix testInvalidSparseListMatrix

SimpleName:IDENTIFIER 74 vectors vectors

SimpleName:IDENTIFIER 74 ArrayList ArrayList

SimpleName:IDENTIFIER 74 SparseDoubleVector SparseDoubleVector

SimpleName:IDENTIFIER 76 vectors vectors

SimpleName:IDENTIFIER 76 CompactSparseVector CompactSparseVector

SimpleName:IDENTIFIER 77 ListMatrix ListMatrix

SimpleName:IDENTIFIER 77 SparseDoubleVector SparseDoubleVector

SimpleName:IDENTIFIER 77 vectors vectors

@Test(expected = IllegalArgumentException.class)
public void testInvalidSparseListMatrix() {
    List<SparseDoubleVector> vectors = new ArrayList<SparseDoubleVector>();
    for (double[] values : INVALID_VALUES) vectors.add(new CompactSparseVector(values));
    Matrix m = new ListMatrix<SparseDoubleVector>(vectors);
}

package edu.ucla.sspace.matrix;

import edu.ucla.sspace.vector.CompactSparseVector;
import edu.ucla.sspace.vector.SparseDoubleVector;
import java.util.ArrayList;
import java.util.List;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_ListMatrixTest {

    private static final double[][] INVALID_VALUES = { { 1, 2, 4, 5 }, { 0, 0, 0, 1, 1 } };

    private static final double[][] VALUES = { { 1, 2, 4, 5 }, { 0, 0, 0, 1 }, { 0, 5, 0, 1 } };
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 40 expected expected

SimpleName:IDENTIFIER 40 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 41 testRemove testRemove

SimpleName:IDENTIFIER 41 Exception Exception

SimpleName:IDENTIFIER 42 getSparseTextSVDLIBCFile getSparseTextSVDLIBCFile

SimpleName:IDENTIFIER 43 SvdlibcSparseTextFileIterator SvdlibcSparseTextFileIterator

@Test(expected = UnsupportedOperationException.class)
public void testRemove() throws Exception {
    File f = getSparseTextSVDLIBCFile();
    Iterator<MatrixEntry> it = new SvdlibcSparseTextFileIterator(f);
    it.remove();
}

package edu.ucla.sspace.matrix;

import java.io.*;
import java.util.*;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_SvdlibcSparseTextFileIteratorTests {

    private static final double[][] testMatrix = { { 1.5, 0.0, 2.5 }, { 0.0, 1.1, 3.1 }, { 1.1, 3.3, 4.1 } };

    private static final int[] numNonZeros = { 2, 2, 3 };

    public static File getSparseTextSVDLIBCFile() throws Exception {
        File f = File.createTempFile("unit-test", ".dat");
        PrintWriter pw = new PrintWriter(f);
        pw.printf("%d %d %d\n", testMatrix.length, testMatrix[0].length, 7);
        for (int c = 0; c < testMatrix[0].length; ++c) {
            pw.printf("%d\n", numNonZeros[c]);
            for (int r = 0; r < testMatrix.length; ++r) if (testMatrix[r][c] != 0d)
                pw.printf("%d %f\n", r, (float) testMatrix[r][c]);
        }
        pw.close();
        return f;
    }
    /*TEST PLACEHOLDER*/
}