@Test public void nullResponseThrows() { try { Result.response(null); fail(); } catch (NullPointerException e) { assertThat(e).hasMessage("response == null"); } }
public static <T> Result<T> response(Response<T> response) { if (response == null) { throw new NullPointerException("mResponse == null"); } return new Result<>(response, null); }
Result { public static <T> Result<T> response(Response<T> response) { if (response == null) { throw new NullPointerException("mResponse == null"); } return new Result<>(response, null); } }
Result { public static <T> Result<T> response(Response<T> response) { if (response == null) { throw new NullPointerException("mResponse == null"); } return new Result<>(response, null); } private  Result(Response<T> response, Throwable error); }
Result { public static <T> Result<T> response(Response<T> response) { if (response == null) { throw new NullPointerException("mResponse == null"); } return new Result<>(response, null); } private  Result(Response<T> response, Throwable error); static Result<T> error(Throwable error); static Result<T> response(Response<T> response); Response<T> response(); Throwable error(); boolean isError(); }
Result { public static <T> Result<T> response(Response<T> response) { if (response == null) { throw new NullPointerException("mResponse == null"); } return new Result<>(response, null); } private  Result(Response<T> response, Throwable error); static Result<T> error(Throwable error); static Result<T> response(Response<T> response); Response<T> response(); Throwable error(); boolean isError();  }