TimeoutException extends RuntimeException { public Timeout getTimeout(){ return timeout; } TimeoutException(Timeout timeout); Timeout getTimeout();  }
@Test public void testConstructorTimeout() throws Exception { Timeout timeout = new Timeout("ode", "sequence", 20_000, 500); TimeoutException timeoutException = new TimeoutException(timeout); assertEquals("The timeouts should be equal.", timeout, timeoutException.getTimeout()); }