@Test
public void testStatsLogging() throws SerializationException {

  DummySerializer serializer = new DummySerializer();
  SerializerProcessor processor = new SerializerProcessor(serializer);
  /*
   * Mock the Stat object
   */
  Stat runtimeStat = mock(Stat.class);
  Stat successStat = mock(Stat.class);
  Stat errorStat = mock(Stat.class);
  processor.setRuntimeStat(runtimeStat);
  processor.setSuccessCountStat(successStat);
  processor.setErrorCountStat(errorStat);
  processor.serialize("foo");
  /*
   * Verify start, stop, increment success count, and never increment error count.
   */
  verify(runtimeStat, times(1)).start();
  verify(runtimeStat, times(1)).stop();
  verify(successStat, times(1)).increment();
  verify(errorStat, never()).increment();
}