Orbit implements Iterable<Integer>, Cloneable { @Override public Object clone() { Orbit orbit = new Orbit(this.label, this.height); for (Integer i : this.atomIndices) { orbit.atomIndices.add(Integer.valueOf(i)); } return orbit; } 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 testClone() { Orbit clonedOrbit = (Orbit) orbit.clone(); List<Integer> indices = orbit.getAtomIndices(); List<Integer> clonedIndices = clonedOrbit.getAtomIndices(); Assert.assertEquals(indices, clonedIndices); Assert.assertEquals(orbit.getLabel(), clonedOrbit.getLabel()); }