HttpStatusCodeHelper { public static boolean isUnauthorized(final int statusCode) { return statusCode == HttpStatus.SC_UNAUTHORIZED; }  static boolean isSuccess(final int statusCode); static boolean isUnauthorized(final int statusCode);  }
@Test public void testIsUnauthorized() throws Exception { assertThat(HttpStatusCodeHelper.isUnauthorized(HttpStatus.SC_TEMPORARY_REDIRECT), equalTo(false)); assertThat(HttpStatusCodeHelper.isUnauthorized(HttpStatus.SC_BAD_REQUEST), equalTo(false)); assertThat(HttpStatusCodeHelper.isUnauthorized(HttpStatus.SC_UNAUTHORIZED), equalTo(true)); assertThat(HttpStatusCodeHelper.isUnauthorized(HttpStatus.SC_PAYMENT_REQUIRED), equalTo(false)); assertThat(HttpStatusCodeHelper.isUnauthorized(HttpStatus.SC_FORBIDDEN), equalTo(false)); }