### Question:
CsvInputFormat extends GenericCsvInputFormat<OUT> { public void setFields(int[] sourceFieldIndices, Class<?>[] fieldTypes) { Preconditions.checkNotNull(sourceFieldIndices); Preconditions.checkNotNull(fieldTypes); checkForMonotonousOrder(sourceFieldIndices, fieldTypes); setFieldsGeneric(sourceFieldIndices, fieldTypes); } CsvInputFormat(Path filePath);  CsvInputFormat(Path filePath, Class<?> ... types);  CsvInputFormat(Path filePath, String lineDelimiter, char fieldDelimiter, Class<?>... types); void setFieldTypes(Class<?> ... fieldTypes); void setFields(int[] sourceFieldIndices, Class<?>[] fieldTypes); void setFields(boolean[] sourceFieldMask, Class<?>[] fieldTypes); Class<?>[] getFieldTypes(); @Override void open(FileInputSplit split); @Override OUT readRecord(OUT reuse, byte[] bytes, int offset, int numBytes); @Override String toString(); static final String DEFAULT_LINE_DELIMITER; static final char DEFAULT_FIELD_DELIMITER; }### Answer:
@Test public void testReadSparseWithShuffledPositions() throws IOException { try { final CsvInputFormat<Tuple3<Integer, Integer, Integer>> format = new CsvInputFormat<Tuple3<Integer, Integer, Integer>>(PATH); format.setFieldDelimiter('|'); try { format.setFields(new int[] {8, 1, 3}, new Class<?>[] {Integer.class, Integer.class, Integer.class}); fail("Input sequence should have been rejected."); } catch (IllegalArgumentException e) { } } catch (Exception ex) { fail("Test failed due to a " + ex.getClass().getName() + ": " + ex.getMessage()); } }