collection.findOneAndUpdate(Filters.eq('_id', id), Updates.set('a', list));
fails with
org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class java.util.Arrays$ArrayList. at org.bson.codecs.configuration.CodecCache.getOrThrow(CodecCache.java:46) ~[mongo-java-driver-3.1.0.jar:na] at org.bson.codecs.configuration.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:63) ~[mongo-java-driver-3.1.0.jar:na] at org.bson.codecs.configuration.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:37) ~[mongo-java-driver-3.1.0.jar:na] at $CodecRegistry_2952b5e77739.get(Unknown Source) ~[na:na] at com.mongodb.client.model.BuildersHelper.encodeValue(BuildersHelper.java:35) ~[mongo-java-driver-3.1.0.jar:na] at com.mongodb.client.model.Updates$SimpleUpdate.toBsonDocument(Updates.java:442) ~[mongo-java-driver-3.1.0.jar:na] at com.mongodb.MongoCollectionImpl.toBsonDocument(MongoCollectionImpl.java:516) ~[mongo-java-driver-3.1.0.jar:na] at com.mongodb.MongoCollectionImpl.findOneAndUpdate(MongoCollectionImpl.java:380) ~[mongo-java-driver-3.1.0.jar:na]