@Test public void testWithCode() { for (int i = 0; i < 10; i++) { final ErrorException exception = ErrorException.withCode(i); assertThat(exception, is(not(nullValue()))); assertThat(exception.getCode(), is(i)); assertThat(exception.getMessage(), is("")); assertThat(exception.getCause(), is(nullValue())); } }
@NonNull public static ErrorException withCode(final int code) { return new ErrorException(code); }
ErrorException extends RuntimeException { @NonNull public static ErrorException withCode(final int code) { return new ErrorException(code); } }
ErrorException extends RuntimeException { @NonNull public static ErrorException withCode(final int code) { return new ErrorException(code); } ErrorException(final int code);  ErrorException(final int code, @Nullable final String message);  ErrorException(final int code, @Nullable final Throwable cause);  ErrorException(final int code, @Nullable final String message, @Nullable final Throwable cause); }
ErrorException extends RuntimeException { @NonNull public static ErrorException withCode(final int code) { return new ErrorException(code); } ErrorException(final int code);  ErrorException(final int code, @Nullable final String message);  ErrorException(final int code, @Nullable final Throwable cause);  ErrorException(final int code, @Nullable final String message, @Nullable final Throwable cause); @NonNull static ErrorException withCode(final int code); final int getCode(); }
ErrorException extends RuntimeException { @NonNull public static ErrorException withCode(final int code) { return new ErrorException(code); } ErrorException(final int code);  ErrorException(final int code, @Nullable final String message);  ErrorException(final int code, @Nullable final Throwable cause);  ErrorException(final int code, @Nullable final String message, @Nullable final Throwable cause); @NonNull static ErrorException withCode(final int code); final int getCode();  }