public static BadRequestException userAlreadyAuthorized(String userName) {
    return new BadRequestException("%s already authorized", userName);
  }
@Test
  public void testUserAlreadyAuthorized(){
    BadRequestException userAlreadyAuthorized = BadRequestException.userAlreadyAuthorized("user");
    assertEquals("user already authorized", userAlreadyAuthorized.getMessage());
  }