@Test public void testMap_Map_Map_EmptyMapping() throws CloneNotSupportedException { IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance(); IAtom c1 = builder.newInstance(IAtom.class, "C"); IAtom o2 = builder.newInstance(IAtom.class, "O"); IAtom n3 = builder.newInstance(IAtom.class, "N"); IAtom c4 = builder.newInstance(IAtom.class, "C"); IAtom h5 = builder.newInstance(IAtom.class, "H"); // new stereo element ITetrahedralChirality original = new TetrahedralChirality(c1, new IAtom[]{o2, n3, c4, h5}, Stereo.CLOCKWISE); // map the existing element a new element - should through an IllegalArgumentException ITetrahedralChirality mapped = original.map(Collections.EMPTY_MAP, Collections.EMPTY_MAP); Assert.assertThat(mapped, is(sameInstance(original))); }
ITetrahedralChirality mapped = original.map(mapping, Collections.EMPTY_MAP);
@Test(expected = IllegalArgumentException.class) public void testMap_Null_Map() throws CloneNotSupportedException { IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance(); IAtom c1 = builder.newInstance(IAtom.class, "C"); IAtom o2 = builder.newInstance(IAtom.class, "O"); IAtom n3 = builder.newInstance(IAtom.class, "N"); IAtom c4 = builder.newInstance(IAtom.class, "C"); IAtom h5 = builder.newInstance(IAtom.class, "H"); // new stereo element ITetrahedralChirality original = new TetrahedralChirality(c1, new IAtom[]{o2, n3, c4, h5}, Stereo.CLOCKWISE); // map the existing element a new element - should through an IllegalArgumentException ITetrahedralChirality mapped = original.map(null, Collections.EMPTY_MAP); }