private TTextProtocolTestMsg testMsg() {
        return new TTextProtocolTestMsg()
                .setA(12345L)
                .setB(5)
                .setC(sub(1, 10))
                .setD(ImmutableList.of(7, 8, 9, 10, 11))
                .setE(ImmutableList.of(
                        sub(2, 100),
                        sub(3, 200),
                        sub(4, 300)
                ))
                .setF(true)
                .setG((byte) 12)
                .setH(ImmutableMap.of(
                        1, 2L,
                        3, 4L,
                        5, 6L
                ))
                .setJ(ImmutableMap.of(
                        (short) 1, ImmutableList.of(true, true, false, true),
                        (short) 5, ImmutableList.of(false)
                ))
                .setK(ImmutableSet.of(true, false, false, false, true))
                .setL(base64Decoder.decode("SGVsbG8gV29ybGQ="))
                .setM("hello \"spherical\" world!")
                .setN((short) 678)
                .setP(Letter.CHARLIE)
                .setQ(EnumSet.allOf(Letter.class))
                .setR(ImmutableMap.of(sub(1, 2), 100L))
                .setS(ImmutableMap.of(
                        ImmutableMap.of(
                                ImmutableMap.of(200L, 400L), 300L
                        ), 100L
                ))
                .setT(ImmutableList.of(Letter.ALPHA, Letter.ALPHA, Letter.CHARLIE, Letter.ALPHA, Letter.CHARLIE,
                                       Letter.ECHO))
                .setU(ImmutableMap.of("foo", Letter.ALPHA, "bar", Letter.DELTA))
                .setV(Letter.BETA)
                .setW(TestUnion.f2(4))
                .setX(ImmutableList.of(TestUnion.f2(5), TestUnion.f1(base64Decoder.decode("SGVsbG8gV29ybGQ="))))
                .setY(Letter.ALPHA)
                .setAa(ImmutableMap.of(Letter.ALPHA, 2, Letter.BETA, 4))
                .setAb(ImmutableMap.of(Letter.CHARLIE, Number.ONE,
                                       Letter.DELTA, Number.THREE,
                                       Letter.BETA, Number.FIVE))
                .setAc(ImmutableMap.of(
                        ImmutableMap.of(Number.ONE, 3),
                        ImmutableMap.of(new NumberSub(Number.TWO),
                                        ImmutableMap.of("ECHO", ImmutableList.of(Letter.ECHO, Letter.ALPHA,
                                                                                 Letter.ALPHA))),
                        ImmutableMap.of(Number.THREE, 5),
                        ImmutableMap.of(new NumberSub(Number.FOUR),
                                        ImmutableMap.of("ALPHA", ImmutableList.of(Letter.BETA, Letter.DELTA)))
                ));
    }
Read in (deserialize) a thrift message in TTextProtocol format
from a file on disk, then serialize it back out to a string.
Finally, deserialize that string and compare to the original
message.
thrift/thrift0.13/src/test/java/com/linecorp/armeria/common/thrift/text/TTextProtocolTest.java