@Test
public void testOxygen1() throws Exception {

    IAtomContainer mol = DefaultChemObjectBuilder.getInstance().newInstance(IAtomContainer.class);
    IAtom carbon = DefaultChemObjectBuilder.getInstance().newInstance(IAtom.class, "C");
    IAtom o1 = DefaultChemObjectBuilder.getInstance().newInstance(IAtom.class, "O");
    IAtom o2 = DefaultChemObjectBuilder.getInstance().newInstance(IAtom.class, "O");
    carbon.setImplicitHydrogenCount(1);
    o1.setImplicitHydrogenCount(1);
    o2.setImplicitHydrogenCount(0);
    IBond bond1 = DefaultChemObjectBuilder.getInstance().newInstance(IBond.class, carbon, o1, IBond.Order.SINGLE);
    IBond bond2 = DefaultChemObjectBuilder.getInstance().newInstance(IBond.class, carbon, o2, IBond.Order.DOUBLE);
    mol.addAtom(carbon);
    mol.addAtom(o1);
    mol.addAtom(o2);
    mol.addBond(bond1);
    mol.addBond(bond2);
    StructGenMatcher matcher = new StructGenMatcher();
    // look at the sp2 O first
    IAtomType matched = matcher.findMatchingAtomType(mol, mol.getAtom(2));
    assertAtomType(testedAtomTypes, "O2", matched);
    matched = matcher.findMatchingAtomType(mol, mol.getAtom(0));
    assertAtomType(testedAtomTypes, "C4", matched);
    matched = matcher.findMatchingAtomType(mol, mol.getAtom(1));
    assertAtomType(testedAtomTypes, "O2", matched);
}