@Test public void buildIgnoreExceptionsPredicate() { Optional<Predicate<Throwable>> optionalPredicate = PredicateCreator .createNegatedExceptionsPredicate(RuntimeException.class, BusinessException.class); then(optionalPredicate).isNotEmpty(); Predicate<Throwable> predicate = optionalPredicate.get(); then(predicate.test(new RuntimeException())).isEqualTo(false); then(predicate.test(new IllegalArgumentException())).isEqualTo(false); then(predicate.test(new Throwable())).isEqualTo(true); then(predicate.test(new Exception())).isEqualTo(true); then(predicate.test(new IOException())).isEqualTo(true); then(predicate.test(new BusinessException())).isEqualTo(false); }
@SafeVarargs public static Optional<Predicate<Throwable>> createNegatedExceptionsPredicate( Class<? extends Throwable>... ignoreExceptions) { return exceptionPredicate(ignoreExceptions) .map(Predicate::negate); }
PredicateCreator { @SafeVarargs public static Optional<Predicate<Throwable>> createNegatedExceptionsPredicate( Class<? extends Throwable>... ignoreExceptions) { return exceptionPredicate(ignoreExceptions) .map(Predicate::negate); } }
PredicateCreator { @SafeVarargs public static Optional<Predicate<Throwable>> createNegatedExceptionsPredicate( Class<? extends Throwable>... ignoreExceptions) { return exceptionPredicate(ignoreExceptions) .map(Predicate::negate); } private  PredicateCreator(); }
PredicateCreator { @SafeVarargs public static Optional<Predicate<Throwable>> createNegatedExceptionsPredicate( Class<? extends Throwable>... ignoreExceptions) { return exceptionPredicate(ignoreExceptions) .map(Predicate::negate); } private  PredicateCreator(); @SafeVarargs static Optional<Predicate<Throwable>> createExceptionsPredicate(
        Class<? extends Throwable>... recordExceptions); @SafeVarargs static Optional<Predicate<Throwable>> createNegatedExceptionsPredicate(
        Class<? extends Throwable>... ignoreExceptions); }
PredicateCreator { @SafeVarargs public static Optional<Predicate<Throwable>> createNegatedExceptionsPredicate( Class<? extends Throwable>... ignoreExceptions) { return exceptionPredicate(ignoreExceptions) .map(Predicate::negate); } private  PredicateCreator(); @SafeVarargs static Optional<Predicate<Throwable>> createExceptionsPredicate(
        Class<? extends Throwable>... recordExceptions); @SafeVarargs static Optional<Predicate<Throwable>> createNegatedExceptionsPredicate(
        Class<? extends Throwable>... ignoreExceptions);  }