BeamToCDK { IAtom newCDKAtom(Atom atom) { Element element = atom.element(); boolean unknown = element == Element.Unknown; if (unknown) { IPseudoAtom pseudoAtom = builder.newInstance(IPseudoAtom.class, element.symbol()); pseudoAtom.setSymbol(element.symbol()); pseudoAtom.setLabel(atom.label()); return pseudoAtom; } return createAtom(element); } BeamToCDK(IChemObjectBuilder builder);   }
@Test public void newUnknownAtom() { IAtom a = g2c.newCDKAtom(AtomBuilder.aliphatic(Element.Unknown).build()); assertThat(a, is(instanceOf(IPseudoAtom.class))); assertThat(((IPseudoAtom) a).getLabel(), is("*")); }
@Test public void newCarbonAtom() { IAtom a = g2c.newCDKAtom(AtomBuilder.aliphatic(Element.Carbon).build()); assertThat(a, is(instanceOf(IAtom.class))); assertThat(a, is(not(instanceOf(IPseudoAtom.class)))); assertThat(a.getSymbol(), is("C")); }
@Test public void newNitrogenAtom() { IAtom a = g2c.newCDKAtom(AtomBuilder.aliphatic(Element.Nitrogen).build()); assertThat(a, is(instanceOf(IAtom.class))); assertThat(a, is(not(instanceOf(IPseudoAtom.class)))); assertThat(a.getSymbol(), is("N")); }