assert val != null && val.length == value.length;
}
}
public void testMarshallingWithRemoval() throws Exception {
ExtendedUUID uuid=ExtendedUUID.randomUUID("A");
byte[] value=Util.objectToByteBuffer("Bela");
for(int i=1; i <= 10; i++)
uuid.put(String.valueOf(i), value);
assert uuid.length() == 10;
System.out.println("uuid = " + uuid);
for(int i=1; i <= 10; i++)
if(i % 2 == 0)
uuid.remove(String.valueOf(i));
System.out.println("uuid = " + uuid);
assert uuid.length() == 5;
int size=uuid.size();
byte[] buffer=Util.streamableToByteBuffer(uuid);
assert size == buffer.length : "expected size of " + size + ", but got " + buffer.length;
ExtendedUUID uuid2=(ExtendedUUID)Util.streamableFromByteBuffer(ExtendedUUID.class,buffer);
System.out.println("uuid2 = " + uuid2);
assert uuid2.length() == 5;
for(int i=1; i <= 10; i++) {
boolean exists=i % 2 != 0;
assert uuid2.keyExists(String.valueOf(i)) == exists;
}
}