### Question:
DefaultPerformanceTiming implements PerformanceTiming { @Override public Object secureConnectionStart() { Object secureConnectionStart = execute(scriptFor(SECURE_CONNECTION_START)); if (secureConnectionStart instanceof Long) { secureConnectionStart = timePassedUntil(secureConnectionStart); } return secureConnectionStart; } DefaultPerformanceTiming(WebDriver driver); @Override long getEventValue(PerformanceTimingEvent event); @Override Object secureConnectionStart(); @Override PerformanceTimingMetrics getMetrics();  }### Answer:
@Test public void shouldReturnSecureConnectionStartAsLong() { when(((JavascriptExecutor) driver).executeScript(SECURE_CONNECTION_START_SCRIPT)).thenReturn(45L); when(((JavascriptExecutor) driver).executeScript(NAVIGATION_START_SCRIPT)).thenReturn(28L); assertThat(performanceTiming.secureConnectionStart()).isEqualTo(17L); verify(((JavascriptExecutor) driver)).executeScript(SECURE_CONNECTION_START_SCRIPT); verify(((JavascriptExecutor) driver)).executeScript(NAVIGATION_START_SCRIPT); verifyNoMoreInteractions(driver); }
@Test public void shouldReturnSecureConnectionStartAsLongAsObject() { when(((JavascriptExecutor) driver).executeScript(SECURE_CONNECTION_START_SCRIPT)).thenReturn("undefined"); assertThat(performanceTiming.secureConnectionStart()).isEqualTo("undefined"); verify(((JavascriptExecutor) driver)).executeScript(SECURE_CONNECTION_START_SCRIPT); verifyNoMoreInteractions(driver); }