@NotNull @Override
    public Optional<? extends Algorithm> parse(
            @Nullable String str, @NotNull DetectionLocation detectionLocation) {
        if (str == null) {
            return Optional.empty();
        }

        return switch (str) {
            case "RSA" -> Optional.of(new RSA(detectionLocation));
            case "DSS" -> Optional.of(new DSS(detectionLocation));
            case "PSK" -> Optional.of(new PSK(detectionLocation));
            case "SHA RSA" ->
                    Optional.of(new RSA(detectionLocation))
                            .map(
                                    signature -> {
                                        signature.put(new SHA(detectionLocation));
                                        return signature;
                                    });
            case "SHA DSS" ->
                    Optional.of(new DSS(detectionLocation))
                            .map(
                                    signature -> {
                                        signature.put(new SHA(detectionLocation));
                                        return signature;
                                    });
            case "SHA" -> Optional.of(new SHA(detectionLocation));
            case "SHA256" -> Optional.of(new SHA2(256, detectionLocation));
            case "SHA384" -> Optional.of(new SHA2(384, detectionLocation));
            case "GOSTR341012" -> Optional.of(new GOSTR341012(detectionLocation));
            case "ECCPWD" -> Optional.of(new ECCPWD(detectionLocation));
            case "KRB5" -> Optional.of(new Kerberos(5, detectionLocation));
            case "ECDSA" -> Optional.of(new ECDSA(detectionLocation));
            case "anon", "ANON" -> Optional.empty(); // Anonymous (anon)
            default -> Optional.empty();
        };
    }
@Test
    public void test() {
        final DetectionLocation testDetectionLocation =
                new DetectionLocation("testfile", 1, 1, List.of("test"), () -> "SSL");

        final AuthenticationAlgorithmMapper mapper = new AuthenticationAlgorithmMapper();
        final Collection<String> authCollection =
                JsonCipherSuites.CIPHER_SUITES.values().stream()
                        .map(JsonCipherSuite::getAuthAlgorithm)
                        .filter(Optional::isPresent)
                        .map(Optional::get)
                        .collect(Collectors.toSet());

        for (String auth : authCollection) {
            if (Objects.equals(auth, "NULL") || Objects.equals(auth, "anon")) {
                continue;
            }

            try {
                assertThat(mapper.parse(auth, testDetectionLocation)).isPresent();
            } catch (AssertionError e) {
                System.out.println("Can't map '" + auth + "'");
                throw e;
            }
        }
    }