@Test
public void oneOfMessage() {

  Message message = TestProtos.OneOfMessage.newBuilder().setBar(1234).build();
  Function<Message, ?> getter = protobufPath(message.getDescriptorForType(), "$.bar");
  assertThat(getter.apply(message), is(1234L));
}