code: public static <T> T parseValue(
        final String json, final Class<T> valueClass, final CodecRegistry codecRegistry) {
      final JsonReader bsonReader = new JsonReader(json);
      bsonReader.readBsonType();
      // We can't detect if their codecRegistry has any duplicate providers. There's also a chance
      // that putting ours first may prevent decoding of some of their classes if for example they
      // have their own way of decoding an Integer.
      final CodecRegistry newReg =
          CodecRegistries.fromRegistries(BsonUtils.DEFAULT_CODEC_REGISTRY, codecRegistry);
      return newReg.get(valueClass).decode(bsonReader, DecoderContext.builder().build());
    }
docs: Parses the provided extended JSON string and decodes it into a T value as specified by the
  provided class type. The type will decoded using the codec found for the type in the provided
  codec registry. If the provided type is not supported by the provided codec registry, the
  method will throw a {@link org.bson.codecs.configuration.CodecConfigurationException}.
  
  @param json the JSON string to parse.
  @param valueClass the class that the JSON string should be decoded into.
  @param codecRegistry the codec registry to use to find the codec for the provided class.
  @param <T> the type into which the JSON string is decoded.
  @return the decoded value.