public synchronized String sign(String str) {
    if (str == null || str.length() == 0) {
      throw new IllegalArgumentException("NULL or empty string to sign");
    }
    byte[] secret = secretProvider.getCurrentSecret();
    String signature = computeSignature(secret, str);
    return str + SIGNATURE + signature;
  }
@Test
  public void testSignature() throws Exception {
    Signer signer = new Signer(createStringSignerSecretProvider());
    String s1 = signer.sign("ok");
    String s2 = signer.sign("ok");
    String s3 = signer.sign("wrong");
    Assert.assertEquals(s1, s2);
    Assert.assertNotEquals(s1, s3);
  }