@SafeVarargs
    public static Optional<Predicate<Throwable>> createExceptionsPredicate(
        Predicate<Throwable> exceptionPredicate,
        Class<? extends Throwable>... exceptions) {
        return PredicateCreator.createExceptionsPredicate(exceptions)
            .map(predicate -> exceptionPredicate == null ? predicate : predicate.or(exceptionPredicate))
            .or(() -> Optional.ofNullable(exceptionPredicate));
    }
@Test
    public void buildComplexRecordExceptionsPredicateOnlyClasses() {
        Predicate<Throwable> exceptionPredicate = null;

        Predicate<Throwable> predicate = PredicateCreator
            .createExceptionsPredicate(exceptionPredicate, IOException.class, RuntimeException.class)
            .orElseThrow();

        then(predicate.test(new RuntimeException())).isTrue();
        then(predicate.test(new IllegalArgumentException())).isTrue();
        then(predicate.test(new Throwable())).isFalse();
        then(predicate.test(new Exception())).isFalse();
        then(predicate.test(new IOException())).isTrue();

    }