EncryptionAlgorithmParser { public static EncryptionAlgorithm parse(String v) { if (v != null) { return EncryptionAlgorithm.forName(v); } return null; } private  EncryptionAlgorithmParser(); static EncryptionAlgorithm parse(String v); static String print(EncryptionAlgorithm v);  }
@Test public void parseAlgos() { assertNotNull(EncryptionAlgorithmParser.parse("RSA")); assertNotNull(EncryptionAlgorithmParser.parse("DSA")); assertNotNull(EncryptionAlgorithmParser.parse("EC")); assertNotNull(EncryptionAlgorithmParser.parse("ECC")); assertNotNull(EncryptionAlgorithmParser.parse("PLAIN-ECDSA")); assertNotNull(EncryptionAlgorithmParser.parse("PLAIN_ECDSA")); assertNotNull(EncryptionAlgorithmParser.parse("Ed25519")); assertNotNull(EncryptionAlgorithmParser.parse("Ed448")); }
@Test public void unsupportedAlgorithmTest() { assertThrows(IllegalArgumentException.class, () -> EncryptionAlgorithmParser.parse("bla")); }