### Question:
DefaultSessionUtil extends SessionUtil { @Override public int generateRequestToken(ByteBuf sessionToken, ByteBuf message, long count) { ByteBuf bytes = generateSessionToken(sessionToken, message, count); return bytes.getInt(bytes.readerIndex()); } 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 testGenerateRequestToken() { 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); int r1 = sessionUtil.generateRequestToken( sessionToken, Unpooled.wrappedBuffer("a new request".getBytes()), epoch); clock.setTime(40000); int r2 = sessionUtil.generateRequestToken( sessionToken, Unpooled.wrappedBuffer("a new request".getBytes()), epoch); Assert.assertEquals(r1, r2); clock.setTime(40000); int r3 = sessionUtil.generateRequestToken( sessionToken, Unpooled.wrappedBuffer("another request".getBytes()), epoch + 1); Assert.assertNotEquals(r1, r3); clock.setTime(60000); int r4 = sessionUtil.generateRequestToken( sessionToken, Unpooled.wrappedBuffer("a new request".getBytes()), epoch + 2); Assert.assertNotEquals(r1, r4); }