ConformerContainer implements List<IAtomContainer> { @Override public boolean add(IAtomContainer atomContainer) { if (this.atomContainer == null) { this.atomContainer = atomContainer; title = (String) atomContainer.getTitle(); } if (title == null) { throw new IllegalArgumentException("At least one of the input molecules does not have a title"); } if (!title.equals(atomContainer.getTitle())) throw new IllegalArgumentException("The input molecules does not have the same title ('" + title + "') as the other conformers ('" + atomContainer.getTitle() + "')"); if (atomContainer.getAtomCount() != this.atomContainer.getAtomCount()) throw new IllegalArgumentException("Doesn't have the same number of atoms as the rest of the conformers"); coordinates.add(getCoordinateList(atomContainer)); return true; } 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(expected = IllegalArgumentException.class) public void testAdd_IAtomContainer() { ConformerContainer container = new ConformerContainer(confs); base.setTitle("junk"); container.add(base); }
@Test public void testAdd_int_IAtomContainer() { ConformerContainer container = new ConformerContainer(confs); container.add(5, confs[5]); }
@Test public void testAdd_int_Object() { ConformerContainer container = new ConformerContainer(confs); container.add(5, confs[5]); }