### Question:
MetricsResource { TimeUnit parseTimeUnit(String value, TimeUnit defaultValue) { try { return TimeUnit.valueOf(String.valueOf(value).toUpperCase(Locale.US)); } catch (IllegalArgumentException e) { return defaultValue; } }  @PostConstruct void init(); @GET @Produces({APPLICATION_JSON, APPLICATION_XML}) Response doGet(); @POST @Produces({APPLICATION_JSON, APPLICATION_XML}) Response doPost(); static final String RATE_UNIT; static final String DURATION_UNIT; static final String SHOW_SAMPLES; static final String METRICS_REGISTRY; static final String ALLOWED_ORIGIN; }### Answer:
@Test public void testPingContent() { MetricsResource mr = new MetricsResource(); Assert.assertEquals(mr.parseTimeUnit("MINUTE", TimeUnit.SECONDS), TimeUnit.SECONDS); Assert.assertEquals(mr.parseTimeUnit("MINUTES", TimeUnit.SECONDS), TimeUnit.MINUTES); }