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