}
@Test
public void testInterop() {
Interop interop = Interop.newBuilder()
.setNullField(null)
.setArrayField(Arrays.asList(new Double[] { 3.14159265, 6.022 }))
.setBoolField(true)
.setBytesField(ByteBuffer.allocate(4).put(new byte[] { 3, 2, 1, 0 }))
.setDoubleField(1.41421)
.setEnumField(Kind.C)
.setFixedField(new MD5(
new byte[] { 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3 }))
.setFloatField(1.61803f)
.setIntField(64)
.setLongField(1024)
.setMapField(Collections.singletonMap("Foo1", new Foo()))
.setRecordField(new Node())
.setStringField("MyInterop")
.setUnionField(2.71828)
.build();
Interop copy = Interop.newBuilder(interop).build();
Assert.assertEquals(interop.getArrayField().size(), copy.getArrayField().size());
Assert.assertEquals(interop.getArrayField(), copy.getArrayField());
Assert.assertEquals(interop.getBoolField(), copy.getBoolField());
Assert.assertEquals(interop.getBytesField().capacity(), copy.getBytesField().capacity());
Assert.assertEquals(interop.getBytesField(), copy.getBytesField());
Assert.assertEquals(interop.getDoubleField(), copy.getDoubleField());
Assert.assertEquals(interop.getEnumField(), copy.getEnumField());
Assert.assertEquals(interop.getFixedField(), copy.getFixedField());
Assert.assertEquals(interop.getFloatField(), copy.getFloatField());
Assert.assertEquals(interop.getIntField(), copy.getIntField());
Assert.assertEquals(interop.getLongField(), copy.getLongField());
Assert.assertEquals(interop.getMapField(), copy.getMapField());
Assert.assertEquals(interop.getRecordField(), copy.getRecordField());
Assert.assertEquals(interop.getStringField(), copy.getStringField());
Assert.assertEquals(interop.getUnionField(), copy.getUnionField());
}