protected static IAtomContainer makeAtomContainer ( IAtom atom , List < IBond > parts , IAtom excludedAtom ) { IAtomContainer partContainer = atom . getBuilder ( ) . newInstance ( IAtomContainer . class ) ; partContainer . addAtom ( atom ) ; for ( IBond aBond : parts ) { for ( IAtom bondedAtom : aBond . atoms ( ) ) { if ( ! bondedAtom . equals ( excludedAtom ) && ! partContainer . contains ( bondedAtom ) ) partContainer . addAtom ( bondedAtom ) ; } if ( ! aBond . contains ( excludedAtom ) ) partContainer . addBond ( aBond ) ; } return partContainer ; }
splitting bond itself