private void testValue(Value v) {
Data data = Data.create(null, 1024);
data.checkCapacity((int) v.getPrecision());
data.writeValue(v);
data.writeInt(123);
data.reset();
Value v2 = data.readValue();
assertEquals(v.getType(), v2.getType());
assertEquals(0, v.compareTo(v2, compareMode));
assertEquals(123, data.readInt());
}