@Override
    public boolean toData(Object o, DataOutput out) throws IOException {

      if (o instanceof NonDataSerializable) {
        fail("toData() should not be invoked with a " + "NonDataSerializable");
      }
      return false;
    }
Make sure a user defined ds with an id of42 bytes works.
geode-core/src/test/java/org/apache/geode/internal/DataSerializableJUnitTest.java