SingleMappingHandler extends AbstractMCSAlgorithm implements IMCSBase { @Override public void searchMCS(boolean bondTypeMatch) { SingleMapping singleMapping = new SingleMapping(); List<Map<IAtom, IAtom>> mappings = null; try { if (this.smartSource == null) { mappings = singleMapping.getOverLaps(source, target, removeHydrogen); } else { mappings = singleMapping.getOverLaps(smartSource, target, removeHydrogen); } } catch (CDKException ex) { Logger.getLogger(SingleMappingHandler.class.getName()).log(Level.SEVERE, null, ex); } setAllAtomMapping(mappings); setAllMapping(mappings); setFirstMapping(); setFirstAtomMapping(); } SingleMappingHandler(boolean removeH); @Override void set(MolHandler source, MolHandler target); @Override void set(IQueryAtomContainer source, IAtomContainer target); @Override void searchMCS(boolean bondTypeMatch); @Override List<Map<Integer, Integer>> getAllMapping(); @Override Map<Integer, Integer> getFirstMapping(); @Override List<Map<IAtom, IAtom>> getAllAtomMapping(); @Override Map<IAtom, IAtom> getFirstAtomMapping();  }
@Test @Override public void testSearchMCS() { IAtom atomSource = new Atom("R"); IAtom atomTarget = new Atom("R"); IAtomContainer source = new AtomContainer(); source.addAtom(atomSource); IAtomContainer target = new AtomContainer(); target.addAtom(atomTarget); boolean removeHydrogen = false; SingleMappingHandler instance = new SingleMappingHandler(removeHydrogen); MolHandler mol1 = new MolHandler(source, true, true); MolHandler mol2 = new MolHandler(target, true, true); instance.set(mol1, mol2); instance.searchMCS(true); assertNotNull(instance.getAllMapping()); assertEquals(1, instance.getAllMapping().size()); }