### Question:
GuaguaRecordWriter extends RecordWriter<Text, Text> { @Override public void write(Text key, Text value) throws IOException, InterruptedException { throw new IOException(String.format("write: Cannot write with %s. Should never be called", getClass() .getName())); }  @Override void close(TaskAttemptContext context); @Override void write(Text key, Text value);  }### Answer:
@Test(expected = RuntimeException.class) public void testWrite() { try { writer.write(new Text(), new Text()); } catch (IOException e) { throw new RuntimeException(e); } catch (InterruptedException e) { throw new RuntimeException(e); } }