### Question:
Results { public static <T> Result<T> fromError(Throwable error) { return new ResultError<T>(error); }  static Result<T> fromValue(T value); static Result<T> fromError(Throwable error);  }### Answer:
@Test public void testException() throws Exception { RuntimeException ex = new RuntimeException(); Result<String> value = Results.fromError(ex); assertFalse(value.isValue()); assertTrue(value.isError()); assertEquals(null, value.getValue()); assertEquals(ex, value.getError()); try { value.get(); fail(); } catch(ExecutionException e) { assertEquals(ex, e.getCause()); } }