### Question:
TaskIOMetricGroup extends ProxyMetricGroup<TaskMetricGroup> { public TaskIOMetricGroup(TaskMetricGroup parent) { super(parent); this.numBytesIn = counter(MetricNames.IO_NUM_BYTES_IN); this.numBytesOut = counter(MetricNames.IO_NUM_BYTES_OUT); this.numBytesInRate = meter(MetricNames.IO_NUM_BYTES_IN_RATE, new MeterView(numBytesIn, 60)); this.numBytesOutRate = meter(MetricNames.IO_NUM_BYTES_OUT_RATE, new MeterView(numBytesOut, 60)); this.numRecordsIn = counter(MetricNames.IO_NUM_RECORDS_IN, new SumCounter()); this.numRecordsOut = counter(MetricNames.IO_NUM_RECORDS_OUT, new SumCounter()); this.numRecordsInRate = meter(MetricNames.IO_NUM_RECORDS_IN_RATE, new MeterView(numRecordsIn, 60)); this.numRecordsOutRate = meter(MetricNames.IO_NUM_RECORDS_OUT_RATE, new MeterView(numRecordsOut, 60)); this.numBuffersOut = counter(MetricNames.IO_NUM_BUFFERS_OUT); this.numBuffersOutRate = meter(MetricNames.IO_NUM_BUFFERS_OUT_RATE, new MeterView(numBuffersOut, 60)); } TaskIOMetricGroup(TaskMetricGroup parent); IOMetrics createSnapshot(); Counter getNumBytesInCounter(); Counter getNumBytesOutCounter(); Counter getNumRecordsInCounter(); Counter getNumRecordsOutCounter(); Counter getNumBuffersOutCounter(); void reuseRecordsInputCounter(Counter numRecordsInCounter); void reuseRecordsOutputCounter(Counter numRecordsOutCounter);  }### Answer:
@Test public void testTaskIOMetricGroup() { TaskMetricGroup task = UnregisteredMetricGroups.createUnregisteredTaskMetricGroup(); TaskIOMetricGroup taskIO = task.getIOMetricGroup(); assertNotNull(taskIO.getNumRecordsInCounter()); assertNotNull(taskIO.getNumRecordsOutCounter()); Counter c1 = new SimpleCounter(); c1.inc(32L); Counter c2 = new SimpleCounter(); c2.inc(64L); taskIO.reuseRecordsInputCounter(c1); taskIO.reuseRecordsOutputCounter(c2); assertEquals(32L, taskIO.getNumRecordsInCounter().getCount()); assertEquals(64L, taskIO.getNumRecordsOutCounter().getCount()); taskIO.getNumBytesInCounter().inc(100L); taskIO.getNumBytesOutCounter().inc(250L); taskIO.getNumBuffersOutCounter().inc(3L); IOMetrics io = taskIO.createSnapshot(); assertEquals(32L, io.getNumRecordsIn()); assertEquals(64L, io.getNumRecordsOut()); assertEquals(100L, io.getNumBytesIn()); assertEquals(250L, io.getNumBytesOut()); assertEquals(3L, taskIO.getNumBuffersOutCounter().getCount()); }