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());
}
}