FastOdsException extends Exception { public static FastOdsException wrongTableNumber(final int n) { return new FastOdsException("Wrong table number [" + n + "]"); } FastOdsException(final String message);  FastOdsException(final Exception e); static FastOdsException wrongTableNumber(final int n); static FastOdsException wrongTableName(final String name);  }
@Test public final void testWrongTableNumber() { final Exception e = FastOdsException.wrongTableNumber(10); Assert.assertEquals("Wrong table number [10]", e.getMessage()); }