ConformerContainer implements List<IAtomContainer> { @Override public int indexOf(Object o) { IAtomContainer atomContainer = (IAtomContainer) o; if (!atomContainer.getTitle().equals(title)) return -1; if (atomContainer.getAtomCount() != this.atomContainer.getAtomCount()) return -1; boolean coordsMatch; int index = 0; for (Point3d[] coords : coordinates) { coordsMatch = true; for (int i = 0; i < atomContainer.getAtomCount(); i++) { Point3d p = atomContainer.getAtom(i).getPoint3d(); if (!(p.x == coords[i].x && p.y == coords[i].y && p.z == coords[i].z)) { coordsMatch = false; break; } } if (coordsMatch) return index; index++; } return -1; } ConformerContainer();  ConformerContainer(IAtomContainer atomContainer);  ConformerContainer(IAtomContainer[] atomContainers); String getTitle(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Iterator<IAtomContainer> iterator(); @Override Object[] toArray(); @Override IAtomContainer[] toArray(IAtomContainer[] ts); @Override boolean add(IAtomContainer atomContainer); @Override boolean remove(Object o); @Override boolean containsAll(Collection<?> objects); @Override boolean addAll(Collection<? extends IAtomContainer> atomContainers); @Override boolean addAll(int i, Collection<? extends IAtomContainer> iAtomContainers); @Override boolean removeAll(Collection<?> objects); @Override boolean retainAll(Collection<?> objects); @Override void clear(); @Override IAtomContainer get(int i); @Override IAtomContainer set(int i, IAtomContainer atomContainer); @Override void add(int i, IAtomContainer atomContainer); @Override IAtomContainer remove(int i); @Override int indexOf(Object o); @Override int lastIndexOf(Object o); @Override ListIterator<IAtomContainer> listIterator(); @Override ListIterator<IAtomContainer> listIterator(int i); @Override List<IAtomContainer> subList(int i, int i1);  }
@Test public void testIndexOf_Object() { ConformerContainer container = new ConformerContainer(confs); Assert.assertNotNull(container); int counter = 0; for (IAtomContainer conf : confs) { Assert.assertEquals(counter, container.indexOf(conf)); counter++; } }