QueryAtomContainerCreator { public static QueryAtomContainer createSymbolAndBondOrderQueryContainer(IAtomContainer container) { return QueryAtomContainer.create(container, Expr.Type.ELEMENT, Expr.Type.ORDER); }  static QueryAtomContainer createBasicQueryContainer(IAtomContainer container); static QueryAtomContainer createSymbolAndBondOrderQueryContainer(IAtomContainer container); static QueryAtomContainer createSymbolAndChargeQueryContainer(IAtomContainer container); static QueryAtomContainer createSymbolChargeIDQueryContainer(IAtomContainer container); static QueryAtomContainer createAnyAtomContainer(IAtomContainer container, boolean aromaticity); static QueryAtomContainer createAnyAtomAnyBondContainer(IAtomContainer container, boolean aromaticity); static QueryAtomContainer createAnyAtomForPseudoAtomQueryContainer(IAtomContainer container); static IAtomContainer suppressQueryHydrogens(IAtomContainer mol);  }
@Test public void test12DimethylBenzene() throws Exception { IChemObjectBuilder builder = SilentChemObjectBuilder.getInstance(); IAtomContainer molecule = builder.newInstance(IAtomContainer.class); molecule.addAtom(builder.newInstance(IAtom.class, "C")); molecule.addAtom(builder.newInstance(IAtom.class, "C")); molecule.addAtom(builder.newInstance(IAtom.class, "C")); molecule.addAtom(builder.newInstance(IAtom.class, "C")); molecule.addAtom(builder.newInstance(IAtom.class, "C")); molecule.addAtom(builder.newInstance(IAtom.class, "C")); molecule.addAtom(builder.newInstance(IAtom.class, "C")); molecule.addAtom(builder.newInstance(IAtom.class, "C")); molecule.addBond(0, 1, IBond.Order.SINGLE); molecule.addBond(1, 2, IBond.Order.DOUBLE); molecule.addBond(2, 3, IBond.Order.SINGLE); molecule.addBond(3, 4, IBond.Order.DOUBLE); molecule.addBond(4, 5, IBond.Order.SINGLE); molecule.addBond(5, 0, IBond.Order.DOUBLE); molecule.addBond(0, 6, IBond.Order.SINGLE); molecule.addBond(1, 7, IBond.Order.SINGLE); IAtomContainer query1 = builder.newInstance(IAtomContainer.class); query1.addAtom(builder.newInstance(IAtom.class, "C")); query1.addAtom(builder.newInstance(IAtom.class, "C")); query1.addAtom(builder.newInstance(IAtom.class, "C")); query1.addAtom(builder.newInstance(IAtom.class, "C")); query1.addAtom(builder.newInstance(IAtom.class, "C")); query1.addAtom(builder.newInstance(IAtom.class, "C")); query1.addBond(0, 1, IBond.Order.SINGLE); query1.addBond(1, 2, IBond.Order.DOUBLE); query1.addBond(3, 0, IBond.Order.DOUBLE); query1.addBond(0, 4, IBond.Order.SINGLE); query1.addBond(1, 5, IBond.Order.SINGLE); QueryAtomContainer queryContainer1 = QueryAtomContainerCreator.createSymbolAndBondOrderQueryContainer(query1); Assert.assertTrue(new UniversalIsomorphismTester().isSubgraph(molecule, queryContainer1)); IAtomContainer query2 = builder.newInstance(IAtomContainer.class); query2.addAtom(builder.newInstance(IAtom.class, "C")); query2.addAtom(builder.newInstance(IAtom.class, "C")); query2.addAtom(builder.newInstance(IAtom.class, "C")); query2.addAtom(builder.newInstance(IAtom.class, "C")); query2.addAtom(builder.newInstance(IAtom.class, "C")); query2.addAtom(builder.newInstance(IAtom.class, "C")); query2.addBond(0, 1, IBond.Order.DOUBLE); query2.addBond(1, 2, IBond.Order.SINGLE); query2.addBond(3, 0, IBond.Order.SINGLE); query2.addBond(0, 4, IBond.Order.SINGLE); query2.addBond(1, 5, IBond.Order.SINGLE); QueryAtomContainer queryContainer2 = QueryAtomContainerCreator.createSymbolAndBondOrderQueryContainer(query2); Assert.assertFalse(new UniversalIsomorphismTester().isSubgraph(molecule, queryContainer2)); }