@Test
public void testP3() throws Exception {

    IAtomContainer mol = DefaultChemObjectBuilder.getInstance().newInstance(IAtomContainer.class);
    IAtom p = DefaultChemObjectBuilder.getInstance().newInstance(IAtom.class, "P");
    IAtom o1 = DefaultChemObjectBuilder.getInstance().newInstance(IAtom.class, "O");
    IAtom o2 = DefaultChemObjectBuilder.getInstance().newInstance(IAtom.class, "O");
    IAtom o3 = DefaultChemObjectBuilder.getInstance().newInstance(IAtom.class, "O");
    IAtom c1 = DefaultChemObjectBuilder.getInstance().newInstance(IAtom.class, "C");
    IAtom c2 = DefaultChemObjectBuilder.getInstance().newInstance(IAtom.class, "C");
    IAtom c3 = DefaultChemObjectBuilder.getInstance().newInstance(IAtom.class, "C");
    c1.setImplicitHydrogenCount(3);
    c2.setImplicitHydrogenCount(3);
    c3.setImplicitHydrogenCount(3);
    IBond bond1 = DefaultChemObjectBuilder.getInstance().newInstance(IBond.class, p, o1, IBond.Order.SINGLE);
    IBond bond2 = DefaultChemObjectBuilder.getInstance().newInstance(IBond.class, p, o2, IBond.Order.SINGLE);
    IBond bond3 = DefaultChemObjectBuilder.getInstance().newInstance(IBond.class, p, o3, IBond.Order.SINGLE);
    IBond bond4 = DefaultChemObjectBuilder.getInstance().newInstance(IBond.class, c1, o1, IBond.Order.SINGLE);
    IBond bond5 = DefaultChemObjectBuilder.getInstance().newInstance(IBond.class, c2, o2, IBond.Order.SINGLE);
    IBond bond6 = DefaultChemObjectBuilder.getInstance().newInstance(IBond.class, c3, o3, IBond.Order.SINGLE);
    mol.addAtom(p);
    mol.addAtom(o1);
    mol.addAtom(o2);
    mol.addAtom(o3);
    mol.addAtom(c1);
    mol.addAtom(c2);
    mol.addAtom(c3);
    mol.addBond(bond1);
    mol.addBond(bond2);
    mol.addBond(bond3);
    mol.addBond(bond4);
    mol.addBond(bond5);
    mol.addBond(bond6);
    StructGenMatcher matcher = new StructGenMatcher();
    IAtomType matched;
    String[] atomTypes = {"P3", "O2", "O2", "O2", "C4", "C4", "C4"};
    for (int i = 0; i < mol.getAtomCount(); i++) {
        matched = matcher.findMatchingAtomType(mol, mol.getAtom(i));
        assertAtomType(testedAtomTypes, atomTypes[i], matched);
    }
}