code: public static void breadthFirstSearch(IAtomContainer atomContainer, List<IAtom> sphere, IAtomContainer molecule) {
          // logger.debug("Staring partitioning with this ac: " + ac);
          breadthFirstSearch(atomContainer, sphere, molecule, -1);
      }
docs: Performs a breadthFirstSearch in an AtomContainer starting with a
  particular sphere, which usually consists of one start atom. While
  searching the graph, the method marks each visited atom. It then puts all
  the atoms connected to the atoms in the given sphere into a new vector
  which forms the sphere to search for the next recursive method call. All
  atoms that have been visited are put into a molecule container. This
  breadthFirstSearch does thus find the connected graph for a given start
  atom.
  
  @param atomContainer The AtomContainer to be searched
  @param sphere        A sphere of atoms to start the search with
  @param molecule      A molecule into which all the atoms and bonds are stored
  that are found during search