In the Java Mongo DB driver version 3 the API has changed as compared to the version 2. So a code like this does not compile anymore:
BasicDBObject personObj = new BasicDBObject();
collection.insert(personObj)
A Collection insert works only with a Mongo Document.
Dealing with the old code I need to ask the question:
What is the best way to convert a BasicDBObject to a Document?