public static HiveFileInfo createHiveFileInfo(LocatedFileStatus locatedFileStatus, Optional<byte[]> extraFileContext)
            throws IOException
    {
        return createHiveFileInfo(
                locatedFileStatus,
                extraFileContext,
                ImmutableMap.of());
    }
@Test
    public void testThriftRoundTrip()
            throws IOException
    {
        ThriftCodec<HiveFileInfo> hiveFileInfoThriftCodec = new ThriftCodecManager().getCodec(HiveFileInfo.class);
        HiveFileInfo hiveFileInfo = createHiveFileInfo(new LocatedFileStatus(
                        100,
                        false,
                        0,
                        0L,
                        0L,
                        0L,
                        null,
                        null,
                        null,
                        null,
                        new Path("test"),
                        new org.apache.hadoop.fs.BlockLocation[] {new BlockLocation(new String[1], new String[] {"localhost"}, 0, 100)}),
                Optional.empty());

        int thriftBufferSize = toIntExact(new DataSize(1000, BYTE).toBytes());
        SliceOutput dynamicSliceOutput = new DynamicSliceOutput(thriftBufferSize);
        ThriftProtocolUtils.write(hiveFileInfo, hiveFileInfoThriftCodec, FB_COMPACT, dynamicSliceOutput);
        byte[] serialized = dynamicSliceOutput.slice().getBytes();

        HiveFileInfo copy = ThriftProtocolUtils.read(hiveFileInfoThriftCodec, FB_COMPACT, Slices.wrappedBuffer(serialized).getInput());
        assertEquals(copy, hiveFileInfo);
    }