code: public static Point2d get2DCenter(IAtomContainer container) {
          double centerX = 0;
          double centerY = 0;
          double counter = 0;
          for (IAtom atom : container.atoms()) {
              if (atom.getPoint2d() != null) {
                  centerX += atom.getPoint2d().x;
                  centerY += atom.getPoint2d().y;
                  counter++;
              }
          }
          return new Point2d(centerX / (counter), centerY / (counter));
      }
docs: Returns the geometric center of all the atoms in the atomContainer. See comment for
  center(IAtomContainer atomCon, Dimension areaDim, HashMap renderingCoordinates) for details
  on coordinate sets
  
  @param container Description of the Parameter
  @return the geometric center of the atoms in this atomContainer