UnauthorizedException extends RuntimeException implements ErrorCode { @Override public Severity severity() { return Severity.WARN; } UnauthorizedException(String message);  UnauthorizedException(String message, Throwable cause); @Override Severity severity(); @Override String errorCode();  }
@Test void severity() { var exception = new UnauthorizedException("error"); assertThat(exception.severity()).isEqualTo(Severity.WARN); }