### Question:
TyrusFuture implements Future<T> { @Override public T get() throws InterruptedException, ExecutionException { latch.await(); if (throwable != null) { throw new ExecutionException(throwable); } return result; }  @Override boolean cancel(boolean mayInterruptIfRunning); @Override boolean isCancelled(); @Override boolean isDone(); @Override T get(); @Override T get(long timeout, TimeUnit unit); void setResult(T result); void setFailure(Throwable throwable);  }### Answer:
@Test public void testGet() throws ExecutionException, InterruptedException { TyrusFuture<String> voidTyrusFuture = new TyrusFuture<String>(); voidTyrusFuture.setResult(RESULT); assertEquals(RESULT, voidTyrusFuture.get()); }
@Test(expected = InterruptedException.class) public void testInterrupted() throws ExecutionException, InterruptedException { TyrusFuture<String> voidTyrusFuture = new TyrusFuture<String>(); Thread.currentThread().interrupt(); voidTyrusFuture.get(); }
@Test(expected = TimeoutException.class) public void testTimeout() throws InterruptedException, ExecutionException, TimeoutException { TyrusFuture<Void> voidTyrusFuture = new TyrusFuture<Void>(); voidTyrusFuture.get(1, TimeUnit.MILLISECONDS); }