### Question:
CDKMCSHandler implements IResults { @Override public synchronized AtomAtomMapping getFirstAtomMapping() { if (allAtomMCS.iterator().hasNext()) { return allAtomMCS.iterator().next(); } return new AtomAtomMapping(source, target); } CDKMCSHandler(IAtomContainer source, IAtomContainer target,
            boolean shouldMatchBonds, boolean shouldMatchRings, boolean matchAtomType);  CDKMCSHandler(IAtomContainer source, IAtomContainer target); @Override synchronized List<AtomAtomMapping> getAllAtomMapping(); @Override synchronized AtomAtomMapping getFirstAtomMapping(); boolean isTimeout(); void setTimeout(boolean timeout);  }### Answer:
@Test public void testSet_IMolecule_IMolecule() throws Exception { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer target = sp.parseSmiles("C\\C=C/Nc1cccc(c1)N(O)\\C=C\\C\\C=C\\C=C/C"); IAtomContainer query = sp.parseSmiles("Nc1ccccc1"); CDKMCSHandler smsd1 = new CDKMCSHandler(query, target, true, false,false); assertNotNull(smsd1.getFirstAtomMapping()); }
@Test public void testSet_AtomContainer_AtomContainer() throws InvalidSmilesException { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer target = sp.parseSmiles("C\\C=C/Nc1cccc(c1)N(O)\\C=C\\C\\C=C\\C=C/C"); IAtomContainer query = sp.parseSmiles("Nc1ccccc1"); CDKMCSHandler instance = new CDKMCSHandler(query, target, true, false,false); assertNotNull(instance.getFirstAtomMapping()); }
@Test public void testGetFirstAtomMapping() throws InvalidSmilesException { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer target = sp.parseSmiles("C\\C=C/Nc1cccc(c1)N(O)\\C=C\\C\\C=C\\C=C/C"); IAtomContainer query = sp.parseSmiles("Nc1ccccc1"); CDKMCSHandler smsd1 = new CDKMCSHandler(query, target, true, false,false); assertNotNull(smsd1.getFirstAtomMapping()); assertEquals(7, smsd1.getFirstAtomMapping().getCount()); }
@Test public void testgetFirstAtomMapping() throws InvalidSmilesException { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer target = sp.parseSmiles("C\\C=C/Nc1cccc(c1)N(O)\\C=C\\C\\C=C\\C=C/C"); IAtomContainer query = sp.parseSmiles("Nc1ccccc1"); CDKMCSHandler smsd1 = new CDKMCSHandler(query, target, true, false,false); assertNotNull(smsd1.getFirstAtomMapping()); assertEquals(7, smsd1.getFirstAtomMapping().getCount()); }