public static byte[] documentRemove(DocumentId docId) {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        try {
            JsonGenerator throwAway = jsonFactory.createGenerator(out);
            throwAway.writeStartObject();
            throwAway.writeStringField(REMOVE, docId.toString());
            throwAway.writeEndObject();
            throwAway.close();
        } catch (IOException e) {
            // Under normal circumstances, nothing here will be triggered
            throw new RuntimeException(e);
        }
        return out.toByteArray();
    }
Utility method to easily serialize a single document ID as a remove
operation.

@param docId
           the document to remove or which has been removed
@return a document remove operation serialised as UTF-8 encoded JSON for
        the input document ID
document/src/main/java/com/yahoo/document/json/JsonWriter.java