  @Test
  public void getReferenceNameShouldReturnCorrectValueForMessages() {

    ProtoTruth.assertThat(
            QueryResponseToProto.buildMessage(
                TestProto.Proto1.getDefaultInstance(),
                ImmutableMap.of(
                    "id",
                    "abc",
                    "intField",
                    123,
                    "testProto",
                    ImmutableMap.of("innerId", "abc_inner", "enums", ImmutableList.of("FOO")))))
        .isEqualTo(
            Proto1.newBuilder()
                .setId("abc")
                .setIntField(123)
                .setTestProto(
                    Proto2.newBuilder()
                        .setInnerId("abc_inner")
                        .addEnumsValue(Proto2.TestEnum.FOO_VALUE))
                .build());
  }