### Question:
DefaultPerformanceTiming implements PerformanceTiming { @Override public PerformanceTimingMetrics getMetrics() { return metricsFactory.createFor(execute(PERFORMANCE_TIMING_SCRIPT)); } DefaultPerformanceTiming(WebDriver driver); @Override long getEventValue(PerformanceTimingEvent event); @Override Object secureConnectionStart(); @Override PerformanceTimingMetrics getMetrics();  }### Answer:
@Test public void shouldGetMetricsObject() { Map<String, Object> metrics = new HashMap<>(); metrics.put("domComplete", 1234L); metrics.put("unloadEventStart", 5678L); metrics.put("navigationStart", 550L); when(((JavascriptExecutor) driver).executeScript(TIMING_OBJECT_SCRIPT)).thenReturn(metrics); assertThat(performanceTiming.getMetrics().getDomComplete()).isEqualTo(684L); assertThat(performanceTiming.getMetrics().getUnloadEventStart()).isEqualTo(5128L); }