ExpectedExceptions { public static boolean isExpected(final Class<?> exceptionClass) { return EXCEPTIONS.stream().anyMatch(each -> each.isAssignableFrom(exceptionClass)); }  static boolean isExpected(final Class<?> exceptionClass);  }
@Test public void assertIsExpected() { assertTrue(ExpectedExceptions.isExpected(ShardingSphereException.class)); assertTrue(ExpectedExceptions.isExpected(ShardingSphereConfigurationException.class)); assertTrue(ExpectedExceptions.isExpected(SQLParsingException.class)); assertTrue(ExpectedExceptions.isExpected(ShardingCTLException.class)); assertTrue(ExpectedExceptions.isExpected(BackendException.class)); assertTrue(ExpectedExceptions.isExpected(NoDatabaseSelectedException.class)); }
@Test public void assertIsNotExpected() { assertFalse(ExpectedExceptions.isExpected(Exception.class)); assertFalse(ExpectedExceptions.isExpected(IllegalArgumentException.class)); }