question: public static Optional < MongoCredential > createCredentials ( String username , String password , String database ) { if ( ! Strings . isNullOrEmpty ( username ) && ! Strings . isNullOrEmpty ( password ) && ! Strings . isNullOrEmpty ( database ) ) { return Optional . of ( MongoCredential . createMongoCRCredential ( username , database , password . toCharArray ( ) ) ) ; } else { return Optional . absent ( ) ; } }
target:  Creates a MongoCredential if a username, password and database are supplied, or returns absent() otherwise