mongodb – List stores reference for Document item in Mongo using java

So the problem i have with mongodb is that it replaces the list value.
I have a for loop and the topics list keeps getting updated and then im doing insertMany for that storing everything in list.
Below example is for understanding purpose

List<String> topics = new ArrayList<>();
topics.add("item1");
topics.add("item2");

list.add(new Document("id", "id").append("readAbout", topics));
System.out.println(list);

topics.clear();
topics.add("item3");
topics.add("item4");
System.out.println(list);
list.add(new Document("id", "id").append("readAbout", topics));
System.out.println(list);

collection.insertMany(list);

Output


(Document{{id=id, readAbout=(item1, item2)}})

(Document{{id=id, readAbout=(item3, item4)}})

(Document{{id=id, readAbout=(item3, item4)}}, Document{{id=id, readAbout=(item3, item4)}})

As you’ll can see the data in list is updated itseems it has reference to that
So is there a way to replace the list and still maintain the data?

Required output

(Document{{id=id, readAbout=(item1, item2)}}, Document{{id=id, readAbout=(item3, item4)}})