MurckoFragmenter implements IFragmenter { @Override public IAtomContainer[] getFragmentsAsContainers() { List<IAtomContainer> allfrags = new ArrayList<IAtomContainer>(); allfrags.addAll(frameMap.values()); allfrags.addAll(ringMap.values()); return allfrags.toArray(new IAtomContainer[0]); } MurckoFragmenter();  MurckoFragmenter(boolean singleFrameworkOnly, int minimumFragmentSize);  MurckoFragmenter(boolean singleFrameworkOnly, int minimumFragmentSize, MoleculeHashGenerator generator); void setComputeRingFragments(boolean val); @Override void generateFragments(IAtomContainer atomContainer); static IAtomContainer scaffold(final IAtomContainer mol); @Override String[] getFragments(); @Override IAtomContainer[] getFragmentsAsContainers(); String[] getRingSystems(); IAtomContainer[] getRingSystemsAsContainers(); String[] getFrameworks(); IAtomContainer[] getFrameworksAsContainers();  }
@Test public void testGetFragmentsAsContainers() throws Exception { IAtomContainer biphenyl = TestMoleculeFactory.makeBiphenyl(); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(biphenyl); Aromaticity.cdkLegacy().apply(biphenyl); MurckoFragmenter fragmenter = new MurckoFragmenter(true, 6); fragmenter.generateFragments(biphenyl); IAtomContainer[] fragments = fragmenter.getFragmentsAsContainers(); assertThat(fragments.length, is(2)); assertThat(fragments[0].getAtomCount(), is(12)); assertThat(fragments[1].getAtomCount(), is(6)); }