RefDataProcessingInfoSerde implements
        Serde<RefDataProcessingInfo>,
        Serializer<RefDataProcessingInfo>,
        Deserializer<RefDataProcessingInfo> { public static boolean wasAccessedAfter(final ByteBuffer processingInfoBuffer, final ByteBuffer timeMsBuffer) { int compareResult = ByteBufferUtils.compareAsLong( timeMsBuffer, timeMsBuffer.position(), processingInfoBuffer, LAST_ACCESSED_TIME_OFFSET); LAMBDA_LOGGER.trace(() -> LogUtil.message("wasAccessedAfter returns {} for test time {} lastAccessed time {}", compareResult, Instant.ofEpochMilli(timeMsBuffer.getLong(0)), Instant.ofEpochMilli(processingInfoBuffer.getLong(LAST_ACCESSED_TIME_OFFSET)))); return compareResult < 0; }  @Override RefDataProcessingInfo deserialize(final ByteBuffer byteBuffer); @Override void serialize(final ByteBuffer byteBuffer, final RefDataProcessingInfo refDataProcessingInfo); void updateState(final ByteBuffer byteBuffer,
                                   final ProcessingState newProcessingState); void updateLastAccessedTime(final ByteBuffer byteBuffer, final long newLastAccessedTimeEpochMs); void updateLastAccessedTime(final ByteBuffer byteBuffer); static ProcessingState extractProcessingState(final ByteBuffer byteBuffer); static long extractLastAccessedTimeMs(final ByteBuffer byteBuffer); static boolean wasAccessedAfter(final ByteBuffer processingInfoBuffer, final ByteBuffer timeMsBuffer); @Override int getBufferCapacity(); static final int CREATE_TIME_OFFSET; static final int LAST_ACCESSED_TIME_OFFSET; static final int EFFECTIVE_TIME_OFFSET; static final int PROCESSING_STATE_OFFSET; }
@Test void wasAccessedAfter() { RefDataProcessingInfo refDataProcessingInfo = new RefDataProcessingInfo( 0L, 1000L, 100L, ProcessingState.COMPLETE); ByteBuffer valueBuffer = serialize(refDataProcessingInfo); doAccessTest(1000L, valueBuffer, false); doAccessTest(999L, valueBuffer, true); doAccessTest(1001L, valueBuffer, false); }