@Test(expected = IllegalArgumentException.class) public void causedBy_causeTypeIsNull() { ExceptionUtil.causedBy(new Exception(), null); }
public static boolean causedBy(Throwable throwable, Class<? extends Throwable> causeType) { assertNotNull(causeType, "causeType"); Set<Throwable> causes = CollectionUtil.createHashSet(); for (; throwable != null && !causeType.isInstance(throwable) && !causes.contains(throwable); throwable = throwable.getCause()) { causes.add(throwable); } return throwable != null && causeType.isInstance(throwable); }
ExceptionUtil { public static boolean causedBy(Throwable throwable, Class<? extends Throwable> causeType) { assertNotNull(causeType, "causeType"); Set<Throwable> causes = CollectionUtil.createHashSet(); for (; throwable != null && !causeType.isInstance(throwable) && !causes.contains(throwable); throwable = throwable.getCause()) { causes.add(throwable); } return throwable != null && causeType.isInstance(throwable); } }
ExceptionUtil { public static boolean causedBy(Throwable throwable, Class<? extends Throwable> causeType) { assertNotNull(causeType, "causeType"); Set<Throwable> causes = CollectionUtil.createHashSet(); for (; throwable != null && !causeType.isInstance(throwable) && !causes.contains(throwable); throwable = throwable.getCause()) { causes.add(throwable); } return throwable != null && causeType.isInstance(throwable); }  }
ExceptionUtil { public static boolean causedBy(Throwable throwable, Class<? extends Throwable> causeType) { assertNotNull(causeType, "causeType"); Set<Throwable> causes = CollectionUtil.createHashSet(); for (; throwable != null && !causeType.isInstance(throwable) && !causes.contains(throwable); throwable = throwable.getCause()) { causes.add(throwable); } return throwable != null && causeType.isInstance(throwable); }  static boolean causedBy(Throwable throwable, Class<? extends Throwable> causeType); static Throwable getRootCause(Throwable throwable); static List<Throwable> getCauses(Throwable throwable); static List<Throwable> getCauses(Throwable throwable, boolean reversed); static RuntimeException toRuntimeException(Exception exception); static RuntimeException toRuntimeException(Exception exception,
            Class<? extends RuntimeException> runtimeExceptionClass); static void throwExceptionOrError(Throwable throwable); static void throwRuntimeExceptionOrError(Throwable throwable); static String getStackTrace(Throwable throwable); }
ExceptionUtil { public static boolean causedBy(Throwable throwable, Class<? extends Throwable> causeType) { assertNotNull(causeType, "causeType"); Set<Throwable> causes = CollectionUtil.createHashSet(); for (; throwable != null && !causeType.isInstance(throwable) && !causes.contains(throwable); throwable = throwable.getCause()) { causes.add(throwable); } return throwable != null && causeType.isInstance(throwable); }  static boolean causedBy(Throwable throwable, Class<? extends Throwable> causeType); static Throwable getRootCause(Throwable throwable); static List<Throwable> getCauses(Throwable throwable); static List<Throwable> getCauses(Throwable throwable, boolean reversed); static RuntimeException toRuntimeException(Exception exception); static RuntimeException toRuntimeException(Exception exception,
            Class<? extends RuntimeException> runtimeExceptionClass); static void throwExceptionOrError(Throwable throwable); static void throwRuntimeExceptionOrError(Throwable throwable); static String getStackTrace(Throwable throwable);  }