### Question:
GraphUtils { public static <V extends ChainVertexInterface,E extends InterfaceEdgeInterface> boolean isAutomorphic(UndirectedGraph<V, E> g) { Map<Integer, Map<Integer,Integer>> repVs = new HashMap<>(); for (V v: g.vertexSet()) { if (!repVs.containsKey(v.getEntityId())) { repVs.put(v.getEntityId(), getInterfaceClusterIdsForVertex(g, v)); } else { Map<Integer,Integer> content = getInterfaceClusterIdsForVertex(g, v); Map<Integer,Integer> repContent = repVs.get(v.getEntityId()); if (repContent.size() != content.size()) return false; for (Entry<Integer, Integer> entry : repContent.entrySet()) { Integer count = content.get(entry.getKey()); if (count == null) return false; if (count != entry.getValue()) return false; } } } return true; }  static SortedMap<Integer,Set<E>> groupIntoTypes(Set<E> edges, boolean byClusters); static int getEdgeMultiplicity(UndirectedGraph<V, E> g, int interfClusterId); static int[] getMultiplicities(List<StructureInterfaceCluster> interfaceClusters, UndirectedGraph<V,E> g); static TreeMap<Integer,Integer> getMultiplicities(UndirectedGraph<V, E> g); static TreeMap<Integer,Integer> getCycleMultiplicities(UndirectedGraph<V, E> g); static UndirectedGraph<V, E> getSubgraphWithSingleInterfaceCluster(
			UndirectedGraph<V, E> g, int interfaceClusterId); static int getNumDistinctInterfaces(UndirectedGraph<V, E> g); static SortedSet<Integer> getDistinctInterfaceClusters(UndirectedGraph<V,E> g); static SortedSet<Integer> getDistinctInterfaces(UndirectedGraph<V,E> g); static int getNumDistinctEntities(UndirectedGraph<V,E> g); static SortedSet<Integer> getDistinctEntities(UndirectedGraph<V,E> g); static int getLargestHeteroInterfaceCluster(UndirectedGraph<V, E> g); static SortedSet<Integer> getDistinctHeteromericInterfaceClusterIds(UndirectedGraph<V, E> g); static boolean isAutomorphic(UndirectedGraph<V, E> g); static boolean isIsomorphicForEntityAndEdgeType(
			UndirectedGraph<V, E> g, int entityId, int interfClusterId); static boolean isInterfClusterIsomorphicForEntities(
			UndirectedGraph<V, E> g, int interfClusterId); static String asString(UndirectedGraph<V, E> g); static String toDot(UndirectedGraph<V, E> g, String title); static boolean areAllIsologous(UndirectedGraph<V, E> g);  }### Answer:
@Test public void testIsAutomorphicNegative() { UndirectedGraph<ChainVertexInterface, InterfaceEdgeInterface> g = new Pseudograph<>(SimpleInterfaceEdge.class); SimpleChainVertex v1 = new SimpleChainVertex("A", 0, 1); SimpleChainVertex v2 = new SimpleChainVertex("B", 0, 1); SimpleChainVertex v3 = new SimpleChainVertex("C", 0, 1); g.addVertex(v1); g.addVertex(v2); g.addVertex(v3); SimpleInterfaceEdge e1 = new SimpleInterfaceEdge(1, 1); SimpleInterfaceEdge e2 = new SimpleInterfaceEdge(2, 2); g.addEdge(v1, v2, e1); g.addEdge(v2, v3, e2); assertFalse(GraphUtils.isAutomorphic(g)); }
@Test public void testIsAutomorphic() { for (int n=2;n<10;n++) { UndirectedGraph<ChainVertexInterface, InterfaceEdgeInterface> g = createCnGraph(n); assertTrue(GraphUtils.isAutomorphic(g)); } for (int n=3;n<10;n++) { UndirectedGraph<ChainVertexInterface, InterfaceEdgeInterface> g = createDnGraph(n); assertTrue(GraphUtils.isAutomorphic(g)); } }