### Question:
AdjacencyListGraph { protected void addEdge(K src, K trg) { Set<K> neighbors = adjacencyMap.computeIfAbsent(src, k -> new HashSet<>()); neighbors.add(trg); neighbors = adjacencyMap.computeIfAbsent(trg, k -> new HashSet<>()); neighbors.add(src); } AdjacencyListGraph(int factorK);  AdjacencyListGraph(AdjacencyListGraph<K> graph);  AdjacencyListGraph(AdjacencyListGraph<K> graph, K src, K trg); int size(); boolean boundedBFS(K src, K trg); AdjacencyListGraph<K> merge(AdjacencyListGraph<K> graph); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testAddEdge() { AdjacencyListGraph<Integer> g = new AdjacencyListGraph<>(3); g.addEdge(1, 2); assertEquals(2, g.adjacencyMap().size()); assertTrue(g.adjacencyMap().get(1).contains(2)); assertTrue(g.adjacencyMap().get(2).contains(1)); assertEquals(1, g.adjacencyMap().get(1).size()); assertEquals(1, g.adjacencyMap().get(2).size()); g.addEdge(1, 3); assertEquals(3, g.adjacencyMap().size()); assertTrue(g.adjacencyMap().get(1).contains(2)); assertTrue(g.adjacencyMap().get(1).contains(3)); assertTrue(g.adjacencyMap().get(3).contains(1)); g.addEdge(3, 1); assertEquals(3, g.adjacencyMap().size()); assertEquals(2, g.adjacencyMap().get(1).size()); assertEquals(1, g.adjacencyMap().get(3).size()); g.addEdge(1, 2); assertEquals(3, g.adjacencyMap().size()); assertEquals(2, g.adjacencyMap().get(1).size()); assertEquals(1, g.adjacencyMap().get(2).size()); }