@Test
    public void shouldNotHaveANullPointerException() {
        final ObjectWritable object = new ObjectWritable<>(null);
        assertNull(object.get());
        assertTrue(object.isEmpty());
        assertTrue(object.equals(ObjectWritable.empty()));
        assertFalse(object.equals(new ObjectWritable<>("hello")));
        assertEquals("null", object.toString());
        assertEquals(-1, object.compareTo(new ObjectWritable<>("blah")));
        assertEquals(-1, new ObjectWritable<>("bloop").compareTo(ObjectWritable.empty()));
        assertEquals(-1, new ObjectWritable<>("bloop").compareTo(object));
        assertEquals(0, ObjectWritable.empty().compareTo(object));
        assertEquals(0, object.compareTo(ObjectWritable.empty()));
        assertEquals(0, object.compareTo(object));
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/ObjectWritableTest.java