Java 297 2

same as #168 , However this time against the latest dev branch (3.0.x)

review @jyemin
[fix https://jira.mongodb.org/browse/JAVA-297]