CDK2DAtomColors implements IAtomColorer, java.io.Serializable { @Override public Color getAtomColor(IAtom atom) { return getAtomColor(atom, hexB31FBA); }  @Override Color getAtomColor(IAtom atom); @Override Color getAtomColor(IAtom atom, Color defaultColor);  }
@Test public void testGetAtomColor() { CDK2DAtomColors colors = new CDK2DAtomColors(); Assert.assertNotNull(colors); IAtom hydrogen = new Atom("H"); hydrogen.setAtomicNumber(1); Assert.assertEquals(new Color(0, 0, 0), colors.getAtomColor(hydrogen)); IAtom helium = new Atom("He"); helium.setAtomicNumber(2); Assert.assertEquals(new Color(217, 255, 255), colors.getAtomColor(helium)); }
@Test public void testGetDefaultAtomColor() { CDK2DAtomColors colors = new CDK2DAtomColors(); Assert.assertNotNull(colors); IAtom imaginary = new PseudoAtom("Ix"); Assert.assertEquals(new Color(0, 0, 0), colors.getAtomColor(imaginary, Color.BLACK)); }