CycleBasis { public int[] weightVector() { SimpleCycleBasis basis = simpleBasis(); List cycles = basis.cycles(); int[] result = new int[cycles.size()]; for (int i = 0; i < cycles.size(); i++) { SimpleCycle cycle = (SimpleCycle) cycles.get(i); result[i] = (int) cycle.weight(); } Arrays.sort(result); return result; } CycleBasis(UndirectedGraph g); int[] weightVector(); Collection cycles(); Collection essentialCycles(); Map relevantCycles(); List equivalenceClasses();  }
@Test public void testWeightVector() { Assert.assertArrayEquals(basis.weightVector(), new int[]{3, 3, 3, 3}); }