PhabricatorHttpClient { void checkNoError(ResultWithError resultWithError) throws PhabricatorException { Preconditions.checkNotNull(resultWithError); if (resultWithError.getErrorCode() != null) { throw new PhabricatorException(resultWithError.getErrorCode() + "\n" + resultWithError.getErrorInfo()); } } PhabricatorHttpClient(String baseUrl, String authToken); T postEntityAndCheckResponse(
            Method method,
            HttpEntity<MultiValueMap<String, Object>> httpEntity,
            Class<T> clazz); HttpEntity<MultiValueMap<String, Object>> getHttpEntityFormUrlEncoded(); HttpEntity<MultiValueMap<String, Object>> getConstraintsForPHID(String phid); HttpEntity<MultiValueMap<String, Object>> withId(String id);  }
@Test(expected = PhabricatorException.class) public void checkNoError() { ResultWithError objectResultWithError = new ResultWithError(); objectResultWithError.setErrorCode("ERR_CODE"); phabricatorHttpClient.checkNoError(objectResultWithError); }