### Question:
DefaultSessionUtil extends SessionUtil { @Override public boolean validateMessage( ByteBuf sessionToken, ByteBuf message, int requestToken, long count) { int generatedToken = generateRequestToken(sessionToken, message, count); return requestToken == generatedToken; } DefaultSessionUtil(Clock clock);   DefaultSessionUtil(); @Override ByteBuf generateSessionToken(ByteBuf key, ByteBuf data, long count); @Override int generateRequestToken(ByteBuf sessionToken, ByteBuf message, long count); @Override boolean validateMessage(
      ByteBuf sessionToken, ByteBuf message, int requestToken, long count); long getThirtySecondsStepsFromEpoch();  }### Answer:
@Test public void testValidateMessage() { clock.setTime(0); ByteBuf key = ByteBufUtil.writeUtf8(ByteBufAllocator.DEFAULT, "super secret password"); String destination = "test"; long epoch = sessionUtil.getThirtySecondsStepsFromEpoch(); ByteBuf 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); }