### Question:
Isomorphism extends BaseMapping implements Serializable { @Override public synchronized boolean isSubgraph() { float mappingSize; if (getMappingCount() > 0) { mappingSize = getAllAtomMapping().iterator().next().getCount(); } else { return false; } int sourceAtomCount = getQuery().getAtomCount(); int targetAtomCount = getTarget().getAtomCount(); if (mappingSize == sourceAtomCount && mappingSize <= targetAtomCount) { if (mappingSize == 1) { return true; } else if (!getAllBondMaps().isEmpty() && getAllBondMaps().iterator().next().size() == getQuery().getBondCount()) { return true; } } return false; } Isomorphism(
            IQueryAtomContainer query,
            IAtomContainer target,
            Algorithm algorithmType);  Isomorphism(
            IAtomContainer query,
            IAtomContainer target,
            Algorithm algorithmType,
            boolean bondTypeFlag,
            boolean matchRings,
            boolean matchAtomType); @Override synchronized boolean isSubgraph(); double getBondSensitiveMcGregorOut(); void setBondSenSitiveMcGregorOut(double bondSensitiveMcGregorOut); double getBondInSensitiveMcGregor(); void setBondInSenSitiveMcGregor(double bondInSensitiveMcGregor);  }### Answer:
@Test public void testQueryAtomContainerDefaultVF2() throws CDKException { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer query = sp.parseSmiles("CC"); IAtomContainer target = sp.parseSmiles("C1CCC12CCCC2"); QueryAtomContainer queryContainer = QueryAtomContainerCreator.createSymbolAndBondOrderQueryContainer(query); Isomorphism smsd = new Isomorphism(queryContainer, target, Algorithm.VFLibMCS); boolean foundMatches = smsd.isSubgraph(); Assert.assertTrue(foundMatches); }
@Test public void testQueryAtomContainerMCSPLUS() throws CDKException { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer query = sp.parseSmiles("CC"); IAtomContainer target = sp.parseSmiles("C1CCC12CCCC2"); Isomorphism smsd = new Isomorphism(query, target, Algorithm.MCSPlus, true, false, true); Assert.assertEquals(18, smsd.getAllAtomMapping().size()); Assert.assertTrue(smsd.isSubgraph()); IQueryAtomContainer queryContainer = QueryAtomContainerCreator.createSymbolAndBondOrderQueryContainer(query); smsd = new Isomorphism(queryContainer, target, Algorithm.MCSPlus); Assert.assertTrue(smsd.isSubgraph()); }
@Test public void testMatchAtomCount() throws CDKException { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer query = sp.parseSmiles("CC"); IAtomContainer target = sp.parseSmiles("C1CCC12CCCC2"); Isomorphism smsd = new Isomorphism(query, target, Algorithm.DEFAULT, true, false, true); Assert.assertEquals(18, smsd.getAllAtomMapping().size()); Assert.assertTrue(smsd.isSubgraph()); IQueryAtomContainer queryContainer = QueryAtomContainerCreator.createSymbolAndBondOrderQueryContainer(query); smsd = new Isomorphism(queryContainer, target, Algorithm.DEFAULT); Assert.assertTrue(smsd.isSubgraph()); }
@Test public void testMatchCountCDKMCS() throws CDKException { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer query = sp.parseSmiles("CC"); IAtomContainer target = sp.parseSmiles("C1CCC12CCCC2"); Isomorphism smsd = new Isomorphism(query, target, Algorithm.CDKMCS, true, false, true); Assert.assertEquals(18, smsd.getAllAtomMapping().size()); Assert.assertTrue(smsd.isSubgraph()); }