### Question:
JobMetrics implements Metrics { @Override public Map<String, Long> getMetrics() { return metrics; } JobMetrics(Job job, String bytesReplicatedGroup, String bytesReplicatedCounter);  JobMetrics(Job job, Enum<?> bytesReplicatedCounter);  JobMetrics(Job job, String bytesReplicatedKey); @Override Map<String, Long> getMetrics(); @Override long getBytesReplicated();  }### Answer:
@Test public void nullJob() throws Exception { Map<String, Long> metrics = new JobMetrics(null, GROUP, COUNTER).getMetrics(); assertThat(metrics.size(), is(0)); }
@Test public void nullCounters() throws Exception { when(job.getCounters()).thenReturn(null); Map<String, Long> metrics = new JobMetrics(job, GROUP, COUNTER).getMetrics(); assertThat(metrics.size(), is(0)); }