### Question:
TimeCalculatingVideoContentHandlerWrapper extends AbstractVideoContentHandler<T> { @Override public synchronized void handleContent(T image, long ptsMillis) { if (myFirstPtsMillis == Long.MIN_VALUE) { myFirstPtsMillis = ptsMillis; } long ptsOffsetMillis = ptsMillis - myFirstPtsMillis; myVideoContentHandler.handleContent(image, ptsMillis); myLatestPtsMillis = ptsMillis; myLatestTime = TimeInstant.get(myStartTime.getEpochMillis() + ptsOffsetMillis); if (myLatestFrameTimeConsumer != null) { myLatestFrameTimeConsumer.accept(myLatestTime); } if (LOGGER.isTraceEnabled()) { if (image == null) { LOGGER.trace("No image produced for time " + TimeInstant.get(myStartTime.getEpochMillis() + ptsOffsetMillis)); } else { LOGGER.trace("Decoded image for time " + TimeInstant.get(myStartTime.getEpochMillis() + ptsOffsetMillis)); } } } TimeCalculatingVideoContentHandlerWrapper(VideoContentHandler<? super T> videoContentHandler, TimeInstant startTime,
            Consumer<TimeInstant> latestFrameTimeConsumer); synchronized long getLatestPtsMillis(); synchronized TimeInstant getLatestTime(); @Override synchronized void handleContent(T image, long ptsMillis); boolean isCompatibleWith(VideoContentHandler<? super ImageIOImage> videoContentHandler, TimeInstant startTime,
            Consumer<TimeInstant> latestFrameTime);  }### Answer:
@Test public void testHandleContent() { long[] times = new long[] { 1000L, 1100L, 1200L }; List<Object> objs = New.list(times.length); for (int index = 0; index < times.length; ++index) { objs.add(new Object()); } EasyMockSupport support = new EasyMockSupport(); @SuppressWarnings("unchecked") VideoContentHandler<Object> wrapped = support.createStrictMock(VideoContentHandler.class); for (int index = 0; index < times.length; ++index) { wrapped.handleContent(objs.get(index), times[index]); } TimeInstant startTime = TimeInstant.get(); @SuppressWarnings("unchecked") Consumer<TimeInstant> timeConsumer = support.createStrictMock(Consumer.class); for (int index = 0; index < times.length; ++index) { timeConsumer.accept(startTime.plus(new Milliseconds(times[index] - times[0]))); } support.replayAll(); try (TimeCalculatingVideoContentHandlerWrapper<Object> handler = new TimeCalculatingVideoContentHandlerWrapper<Object>( wrapped, startTime, timeConsumer)) { for (int index = 0; index < times.length; ++index) { handler.handleContent(objs.get(index), times[index]); } } support.verifyAll(); }