MapFileOutputFormat extends FileOutputFormat<WritableComparable<?>, Writable> { public static <K extends WritableComparable<?>, V extends Writable> Writable getEntry(MapFile.Reader[] readers, Partitioner<K, V> partitioner, K key, V value) throws IOException { int readerLength = readers.length; int part; if (readerLength <= 1) { part = 0; } else { part = partitioner.getPartition(key, value, readers.length); } return readers[part].get(key, value); }  RecordWriter<WritableComparable<?>, Writable> getRecordWriter(
      TaskAttemptContext context); static MapFile.Reader[] getReaders(Path dir,
      Configuration conf); static Writable getEntry(MapFile.Reader[] readers, 
      Partitioner<K, V> partitioner, K key, V value);  }
@SuppressWarnings("static-access") @Test public void testPartitionerShouldNotBeCalledWhenOneReducerIsPresent() throws Exception { MapFileOutputFormat outputFormat = new MapFileOutputFormat(); Reader reader = Mockito.mock(Reader.class); Reader[] readers = new Reader[]{reader}; outputFormat.getEntry(readers, new MyPartitioner(), new Text(), new Text()); assertTrue(!MyPartitioner.isGetPartitionCalled()); }