ResponseContentUtil { public static ResponseContent<?> handleException(final String errorMsg) { ResponseContent<?> result = new ResponseContent<>(); result.setSuccess(false); result.setErrorCode(ResponseCode.SERVER_ERROR); result.setErrorMsg(errorMsg); return result; }  static ResponseContent<?> success(); static ResponseContent<T> build(final T model); static ResponseContent<?> handleBadRequest(final String errorMsg); static ResponseContent<?> handleException(final String errorMsg);  }
@Test public void assertHandleException() { ResponseContent<?> responseContent = ResponseContentUtil.handleException(ERROR_MESSAGE); assertThat(responseContent.getErrorMsg(), is(ERROR_MESSAGE)); assertThat(responseContent.getErrorCode(), is(ResponseCode.SERVER_ERROR)); assertNull(responseContent.getModel()); }