TestOneof2 message2 = TestOneof2.parseFrom(rawBytes);
TestUtil.assertOneofSet(message2);
}
public void testOneofOnlyLastSet() throws Exception {
TestOneofBackwardsCompatible source = TestOneofBackwardsCompatible
.newBuilder().setFooInt(100).setFooString("101").build();
ByteString rawBytes = source.toByteString();
TestOneof2 message = TestOneof2.parseFrom(rawBytes);
assertFalse(message.hasFooInt());
assertTrue(message.hasFooString());
}