You will get a MongoException.DuplicateKey exception
http://api.mongodb.org/java/current/com/mongodb/MongoException.DuplicateKey.html
However, it will depend, I believe on your write concern. Since you can:
set errors ignored write concern, specify w values of -1 to your driver.
This turns off write acknowledgments.
http://docs.mongodb.org/manual/core/write-concern/
With Errors Ignored set:
With this level of write concern, the client cannot detect failed write operations.
By default, the Acknowledged write concern is enabled in the driver as of Driver Java, version 2.10.0, this was not the case in the previous release. So, check which driver you're using as well.