public static FatalExceptionClassifier createChain(FatalExceptionClassifier... classifiers) {
        Set<FatalExceptionClassifier> importedClassifiers = new HashSet<>();

        if (classifiers.length == 0) {
            throw new IllegalArgumentException("Cannot create empty classifier chain.");
        }

        FatalExceptionClassifier tailClassifier = classifiers[0];
        importedClassifiers.add(tailClassifier);

        for (int i = 1; i < classifiers.length; ++i) {
            if (importedClassifiers.contains(classifiers[i])) {
                throw new IllegalArgumentException(
                        "Wrong classifier chain; Circular chain of classifiers detected.");
            }

            tailClassifier.chainedClassifier = classifiers[i];
            tailClassifier = classifiers[i];
            importedClassifiers.add(tailClassifier);
        }

        return classifiers[0];
    }
@Test
    public void circularChainedFatalExceptionClassifierThrowsException() {
        assertThatExceptionOfType(IllegalArgumentException.class)
                .isThrownBy(
                        () ->
                                FatalExceptionClassifier.createChain(
                                        ARITHMETIC_EXCEPTION_STRATEGY,
                                        NULL_POINTER_EXCEPTION_STRATEGY,
                                        ARITHMETIC_EXCEPTION_STRATEGY))
                .withMessageContaining(
                        "Wrong classifier chain; Circular chain of classifiers detected");
    }