### Question:
HdfsUtilities { public static FileSplit parseFileSplit(RequestContext requestContext) { FragmentMetadata metadata = Utilities.parseFragmentMetadata(requestContext); return new FileSplit(new Path(requestContext.getDataSource()), metadata.getStart(), metadata.getEnd(), (String[]) null); }  static byte[] prepareFragmentMetadata(FileSplit fsp); static byte[] prepareFragmentMetadata(long start, long length, String[] locations); static FileSplit parseFileSplit(RequestContext requestContext); static void validateFile(Path file, FileSystem fs); static String toString(List<OneField> complexRecord, String delimiter);  }### Answer:
@Test public void testParseFileSplit() throws Exception { RequestContext context = new RequestContext(); context.setDataSource("/abc/path/to/data/source"); ByteArrayOutputStream bas = new ByteArrayOutputStream(); ObjectOutputStream os = new ObjectOutputStream(bas); os.writeLong(10); os.writeLong(100); os.writeObject(new String[]{"hostname"}); os.close(); context.setFragmentMetadata(bas.toByteArray()); FileSplit fileSplit = HdfsUtilities.parseFileSplit(context); assertEquals(fileSplit.getStart(), 10); assertEquals(fileSplit.getLength(), 100); assertEquals(fileSplit.getPath().toString(), "/abc/path/to/data/source"); }