Mic { public static Mic valueOf(String receivedContentMic) throws NoSuchAlgorithmException { String s[] = receivedContentMic.split(","); if (s.length != 2) { throw new IllegalArgumentException("Invalid mic: '" + receivedContentMic + "'. Required syntax: encoded-message-digest \",\" (sha1|md5)"); } return new Mic(s[0].trim(), SMimeDigestMethod.findByIdentifier(s[1].trim())); } Mic(Digest digest);  Mic(String digestAsString, SMimeDigestMethod algorithm); static Mic valueOf(String receivedContentMic); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testValueOf() throws Exception { Mic mic = Mic.valueOf("eeWNkOTx7yJYr2EW8CR85I7QJQY=, sha1"); assertNotNull(mic); }