### Question:
UInt8 extends Message { public byte getData() { return this.data; } UInt8();  UInt8(byte data); byte getData(); @Override UInt8 clone(); static UInt8 fromJsonString(java.lang.String jsonString); static UInt8 fromMessage(Message m); static UInt8 fromJsonObject(JsonObject jsonObject); static final java.lang.String FIELD_DATA; static final java.lang.String TYPE; }### Answer:
@Test public void testConstructor() { assertEquals((byte) 0, empty.getData()); assertEquals("{\"data\":0}", empty.toString()); assertEquals(1, empty.toJsonObject().size()); assertEquals( (byte) 0, Primitive.toUInt8((short) empty.toJsonObject().getInt( UInt8.FIELD_DATA))); assertEquals(UInt8.TYPE, empty.getMessageType()); }
@Test public void testByteConstructor() { assertEquals((byte) 123, i1.getData()); assertEquals("{\"data\":123}", i1.toString()); assertEquals(1, i1.toJsonObject().size()); assertEquals( (byte) 123, Primitive.toUInt8((short) i1.toJsonObject().getInt( UInt8.FIELD_DATA))); assertEquals(UInt8.TYPE, i1.getMessageType()); }
@Test public void testByteConstructorNegative() { UInt8 c = new UInt8((byte) -1); assertEquals((byte) -1, c.getData()); assertEquals("{\"data\":255}", c.toString()); assertEquals(1, c.toJsonObject().size()); assertEquals( (byte) -1, Primitive.toUInt8((short) c.toJsonObject().getInt( UInt8.FIELD_DATA))); assertEquals(UInt8.TYPE, c.getMessageType()); }