driver-legacy/src/main/com/mongodb/util/JSON.java
public static void serialize(final Object object, final StringBuilder buf) {
        JSONSerializers.getLegacy().serialize(object, buf);
    }
public static void serialize(final Object object, final StringBuilder buf) {
        JSONSerializers.getLegacy().serialize(object, buf);
    }
<p>Serializes an object into its JSON form.</p>

<p>This method delegates serialization to {@code JSONSerializers.getLegacy}</p>

@param object   object to serialize
@param buf StringBuilder containing the JSON representation under construction
@see JSONSerializers#getLegacy()