VFlibMCSHandler extends AbstractMCSAlgorithm implements IMCSBase { @Override public void searchMCS(boolean bondTypeMatch) { setBondMatchFlag(bondTypeMatch); searchVFMCSMappings(); boolean flag = mcgregorFlag(); if (flag && !vfLibSolutions.isEmpty()) { try { searchMcGregorMapping(); } catch (CDKException ex) { LOGGER.error(Level.SEVERE, null, ex); } catch (IOException ex) { LOGGER.error(Level.SEVERE, null, ex); } } else if (!allAtomMCSCopy.isEmpty()) { allAtomMCS.addAll(allAtomMCSCopy); allMCS.addAll(allMCSCopy); } setFirstMappings(); } VFlibMCSHandler(); @Override void searchMCS(boolean bondTypeMatch); @Override void set(MolHandler reactant, MolHandler product); @Override void set(IQueryAtomContainer source, IAtomContainer target); @Override List<Map<IAtom, IAtom>> getAllAtomMapping(); @Override List<Map<Integer, Integer>> getAllMapping(); @Override Map<IAtom, IAtom> getFirstAtomMapping(); @Override Map<Integer, Integer> getFirstMapping(); boolean isBondMatchFlag(); void setBondMatchFlag(boolean shouldMatchBonds);  }
@Test @Override public void testSearchMCS() { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer target = null; try { target = sp.parseSmiles("C\\C=C/Nc1cccc(c1)N(O)\\C=C\\C\\C=C\\C=C/C"); } catch (InvalidSmilesException ex) { Logger.getLogger(VFlibMCSHandlerTest.class.getName()).log(Level.SEVERE, null, ex); } IAtomContainer queryac = null; try { queryac = sp.parseSmiles("Nc1ccccc1"); } catch (InvalidSmilesException ex) { Logger.getLogger(VFlibMCSHandlerTest.class.getName()).log(Level.SEVERE, null, ex); } VFlibMCSHandler smsd1 = new VFlibMCSHandler(); MolHandler mol1 = new MolHandler(queryac, true, true); MolHandler mol2 = new MolHandler(target, true, true); smsd1.set(mol1, mol2); smsd1.searchMCS(true); assertNotNull(smsd1.getFirstMapping()); }