### Question:
ThreadContextImplementation implements ThreadContext { public DispatchResultReporter getDispatchResultReporter() { return m_dispatchResultReporter; } ThreadContextImplementation(GrinderProperties properties,
                                     StatisticsServices statisticsServices,
                                     int threadNumber,
                                     Logger dataLogger); int getThreadNumber(); int getRunNumber(); @Override void setCurrentRunNumber(int run); SSLContextFactory getThreadSSLContextFactory(); void setThreadSSLContextFactory(SSLContextFactory sslContextFactory); DispatchResultReporter getDispatchResultReporter(); void registerThreadLifeCycleListener(
    ThreadLifeCycleListener listener); void removeThreadLifeCycleListener(ThreadLifeCycleListener listener); void fireBeginThreadEvent(); void fireBeginRunEvent(); void fireEndRunEvent(); void fireBeginShutdownEvent(); void fireEndThreadEvent(); void pushDispatchContext(DispatchContext dispatchContext); void popDispatchContext(); StatisticsForTest getStatisticsForCurrentTest(); StatisticsForTest getStatisticsForLastTest(); void setDelayReports(boolean b); void reportPendingDispatchContext(); void pauseClock(); void resumeClock(); void shutdown(); @Override Marker getLogMarker();  }### Answer:
@Test public void testDispatchResultReporter() throws Exception { final ThreadContext threadContext = new ThreadContextImplementation(m_properties, m_statisticsServices, 1, m_dataLogger); final DispatchResultReporter dispatchResultReporter = threadContext.getDispatchResultReporter(); final net.grinder.common.Test test = new StubTest(22, "test"); final StatisticsSet statistics = m_statisticsServices.getStatisticsSetFactory().create(); dispatchResultReporter.report(test, 123456, statistics); verify(m_dataLogger).info(and(contains("22"), contains("123456")), isA(DataLogArguments.class)); }
@Test public void testNullDispatchResultReporter() throws Exception { when(m_properties.getProperty("grinder.logData")).thenReturn("false"); final ThreadContext threadContext = new ThreadContextImplementation(m_properties, m_statisticsServices, 1, m_dataLogger); final DispatchResultReporter dispatchResultReporter = threadContext.getDispatchResultReporter(); final net.grinder.common.Test test = new StubTest(22, "test"); final StatisticsSet statistics = m_statisticsServices.getStatisticsSetFactory().create(); dispatchResultReporter.report(test, 123456, statistics); verifyNoMoreInteractions(m_dataLogger); }