public static void fieldNameIfNotNull(JsonGenerator generator, FieldBase field) {
        if (field != null) {
            wrapIOException(() -> generator.writeFieldName(field.getName()));
        }
    }
@author Steinar Knutsen
@author Vegard Sjonfjell
document/src/main/java/com/yahoo/document/json/JsonSerializationHelper.java