code: public static List<IChemObject> getAllChemObjects(IChemFile file) {
          List<IChemObject> list = new ArrayList<IChemObject>();
          //list.add(file); // should not add the original file
          for (int i = 0; i < file.getChemSequenceCount(); i++) {
              list.add(file.getChemSequence(i));
              list.addAll(ChemSequenceManipulator.getAllChemObjects(file.getChemSequence(i)));
          }
          return list;
      }
docs: Returns a List of all IChemObject inside a ChemFile.
  
  @return  A list of all ChemObjects