If an org.bson.Document contains a field whose value is a Set, serialization fails with
org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class java.util.Collections$UnmodifiableSet. at org.bson.codecs.configuration.CodecCache.getOrThrow(CodecCache.java:46) at org.bson.codecs.configuration.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:63) at org.bson.codecs.configuration.ChildCodecRegistry.get(ChildCodecRegistry.java:51) at org.bson.codecs.DocumentCodec.writeValue(DocumentCodec.java:174) at org.bson.codecs.DocumentCodec.writeMap(DocumentCodec.java:189) at org.bson.codecs.DocumentCodec.writeValue(DocumentCodec.java:172) ... at org.bson.codecs.DocumentCodec.encode(DocumentCodec.java:131) at org.bson.codecs.DocumentCodec.encode(DocumentCodec.java:45)