@Test
public void testValidateMessage() {

  clock.setTime(0);
  byte[] key = "super secret password".getBytes();
  String destination = "test";
  long epoch = sessionUtil.getThirtySecondsStepsFromEpoch();
  byte[] sessionToken =
      sessionUtil.generateSessionToken(
          key, Unpooled.wrappedBuffer(destination.getBytes()), epoch);
  byte[] message = "a request".getBytes();
  int requestToken =
      sessionUtil.generateRequestToken(sessionToken, Unpooled.wrappedBuffer(message), epoch + 1);
  boolean valid =
      sessionUtil.validateMessage(
          sessionToken, Unpooled.wrappedBuffer(message), requestToken, epoch + 1);
  Assert.assertTrue(valid);
  clock.setTime(40000);
  valid =
      sessionUtil.validateMessage(
          sessionToken, Unpooled.wrappedBuffer(message), requestToken, epoch + 2);
  Assert.assertFalse(valid);
}