### Question:
Signer { public String verifyAndExtract(String signedStr) throws SignerException { int index = signedStr.lastIndexOf(SIGNATURE); if (index == -1) { throw new SignerException("Invalid signed text: " + signedStr); } String originalSignature = signedStr.substring(index + SIGNATURE.length()); String rawValue = signedStr.substring(0, index); checkSignatures(rawValue, originalSignature); return rawValue; } Signer(SignerSecretProvider secretProvider); synchronized String sign(String str); String verifyAndExtract(String signedStr);  }### Answer:
@Test public void testInvalidSignedText() throws Exception { Signer signer = new Signer(createStringSignerSecretProvider()); try { signer.verifyAndExtract("test"); Assert.fail(); } catch (SignerException ex) { } catch (Throwable ex) { Assert.fail(); } }