Pattern pat2 = Pattern.compile(".*", BSON.regexFlags(""));
assert (pat.pattern().equals(pat2.pattern()));
assert (pat.flags() == (pat2.flags()));
ObjectId oid = (ObjectId) a.get("oid");
assert (oid.equals(new ObjectId("4d83ab3ea39562db9c1ae2ae")));
DBRef ref = (DBRef) a.get("ref");
assert (ref.equals(new DBRef(null, "test.test", new ObjectId("4d83ab59a39562db9c1ae2af"))));
assert (a.get("code").equals(new Code("asdfdsa")));
assert (a.get("codews").equals(new CodeWScope("ggggg", new BasicBSONObject())));
assert (a.get("ts").equals(new BSONTimestamp(1300474885, 10)));
assert (a.get("uuid").equals(UUID.fromString("60f65152-6d4a-4f11-9c9b-590b575da7b5")));
String json2 = JSON.serialize(a);