code: public <ResultT> ResultT findOneAndReplace(
            final Bson filter,
            final Bson replacement,
            final RemoteFindOneAndModifyOptions options,
            final Class<ResultT> resultClass) {
      return operations.findOneAndModify(
              "findOneAndReplace",
              filter,
              replacement,
              options,
              resultClass).execute(service);
    }
docs: Finds a document in the collection and replaces it with the given document
  
  @param filter the query filter
  @param replacement the document to replace the matched document with
  @param options     A RemoteFindOneAndModifyOptions struct
  @param resultClass the class to decode each document into
  @param <ResultT>   the target document type of the iterable.
  @return the resulting document