code: private static IAtom findPiBondedOxygen(IAtomContainer container, IAtom atom) {
          for (IBond bond : container.getConnectedBondsList(atom)) {
              if (bond.getOrder() == IBond.Order.DOUBLE) {
                  IAtom neighbor = bond.getOther(atom);
                  int charge = neighbor.getFormalCharge() == null ? 0 : neighbor.getFormalCharge();
                  if (neighbor.getAtomicNumber() == 8 && charge == 0) return neighbor;
              }
          }
          return null;
      }
docs: Find a neutral oxygen bonded to the {@code atom} with a pi bond.
  
  @param container the container
  @param atom      an atom from the container
  @return a pi bonded oxygen (or null if not found)