UUIDTemplate extends AbstractTemplate<UUID> { @Override public void write(Packer packer, UUID uuid, boolean required) throws IOException { packer.write(uuid.toString()); } private  UUIDTemplate(); static Template<UUID> getInstance(); @Override void write(Packer packer, UUID uuid, boolean required); @Override UUID read(Unpacker unpacker, UUID uuid, boolean required);  }
@Test public void write() throws IOException { UUID uuid = UUID.randomUUID(); MessagePack pack = new MessagePack(); byte[] bytes = pack.write(uuid.toString()); byte[] result = pack.write(uuid, UUIDTemplate.getInstance()); Assert.assertArrayEquals(bytes, result); }