### Question:
Results { public static <T> Result<T> fromValue(T value) { return new ResultValue<T>(value); }  static Result<T> fromValue(T value); static Result<T> fromError(Throwable error);  }### Answer:
@Test public void testValue() throws Exception { Result<String> value = Results.fromValue("test"); assertTrue(value.isValue()); assertFalse(value.isError()); assertEquals("test", value.getValue()); assertEquals(null, value.getError()); assertEquals("test", value.get()); }
@Test public void testNullValue() throws Exception { Result<String> value = Results.fromValue(null); assertTrue(value.isValue()); assertFalse(value.isError()); assertEquals(null, value.getValue()); assertEquals(null, value.getError()); assertEquals(null, value.get()); }