StacktraceHash implements IStacktraceHash { public boolean isAlgorithmAvailable() { try { MessageDigest.getInstance(algorithm); return true; } catch (NoSuchAlgorithmException e) { return false; } } StacktraceHash(final String algorithm);  StacktraceHash(); String getAlgorithm(); @Override String hash(final IStacktrace st); boolean isAlgorithmAvailable(); static final String DEFAULT_ALGORITHM; }
@Test public void testIsAlgorithmAvailableValid() { StacktraceHash h = new StacktraceHash(); assertTrue(h.isAlgorithmAvailable()); }
@Test public void testIsAlgorithmAvailableInvalid() { StacktraceHash h = new StacktraceHash("InvalidAlgorithm"); assertFalse(h.isAlgorithmAvailable()); }