object.set("type_decimal", new BigDecimal("1234.567"));
object.set("type_text", new Text("Hello, world!"));
object.set("type_date", new Date(2011, 3, 31));
object.set("type_datetime", new DateTime(2011, 3, 31, 23, 30, 1));
Writable writable = (Writable) object.unwrap();
DataOutputBuffer output = new DataOutputBuffer();
writable.write(output);
Writable copy = (Writable) loader.newModel("Primitives").unwrap();
DataInputBuffer input = new DataInputBuffer();
input.reset(output.getData(), output.getLength());
copy.readFields(input);
assertThat(input.read(), is(-1));
assertThat(writable, equalTo(copy));
}