diff --git a/src/test/org/bson/BSONTest.java b/src/test/org/bson/BSONTest.java
index <HASH>..<HASH> 100644
--- a/src/test/org/bson/BSONTest.java
+++ b/src/test/org/bson/BSONTest.java
@@ -164,18 +164,14 @@ public class BSONTest {
     public void testUTF8() {
         for (int i = 1; i <= Character.MAX_CODE_POINT; i++) {
 
-            if (!Character.isValidCodePoint(i)) {
-                continue;
-            }
-
-            if (Character.isSurrogate((char) i)) {
+            if (Character.getType(i) == Character.SURROGATE) {
                 continue;
             }
 
             String orig = new String(Character.toChars(i));
             BSONObject a = new BasicBSONObject(orig, orig);
             BSONObject b = BSON.decode(BSON.encode(a));
-            assertEquals(a, b);
+            assertEquals("Could not round trip code point " + i, a, b);
         }
     }
Fixed BSONTest.testUTF8 so that it compiles with Java 6.