### Question:
AvroKeyInputFormat extends FileInputFormat<AvroKey<T>, NullWritable> { @Override public RecordReader<AvroKey<T>, NullWritable> createRecordReader(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { Schema readerSchema = AvroJob.getInputKeySchema(context.getConfiguration()); if (null == readerSchema) { LOG.warn("Reader schema was not set. Use AvroJob.setInputKeySchema() if desired."); LOG.info("Using a reader schema equal to the writer schema."); } return new AvroKeyRecordReader<>(readerSchema); }  @Override RecordReader<AvroKey<T>, NullWritable> createRecordReader(InputSplit split, TaskAttemptContext context);  }### Answer:
@Test public void testCreateRecordReader() throws IOException, InterruptedException { Job job = Job.getInstance(); AvroJob.setInputKeySchema(job, Schema.create(Schema.Type.STRING)); Configuration conf = job.getConfiguration(); FileSplit inputSplit = createMock(FileSplit.class); TaskAttemptContext context = createMock(TaskAttemptContext.class); expect(context.getConfiguration()).andReturn(conf).anyTimes(); replay(inputSplit); replay(context); AvroKeyInputFormat inputFormat = new AvroKeyInputFormat(); @SuppressWarnings("unchecked") RecordReader<AvroKey<Object>, NullWritable> recordReader = inputFormat.createRecordReader(inputSplit, context); assertNotNull(inputFormat); recordReader.close(); verify(inputSplit); verify(context); }