Orbit implements Iterable<Integer>, Cloneable { @Override public Iterator<Integer> iterator() { return this.atomIndices.iterator(); } Orbit(String label, int height); @Override Iterator<Integer> iterator(); @Override Object clone(); void sort(); int getHeight(); List<Integer> getAtomIndices(); void addAtom(int atomIndex); boolean hasLabel(String otherLabel); boolean isEmpty(); int getFirstAtom(); void remove(int atomIndex); String getLabel(); boolean contains(int atomIndex); @Override String toString();  }
@Test public void iteratorTest() { int count = 0; List<Integer> indices = orbit.getAtomIndices(); for (Integer i : orbit) { Assert.assertEquals(i, indices.get(count)); count++; } Assert.assertEquals(indices.size(), count); }