@Test(expected = RuntimeException.class)
public void testOnUnexpectedError() {

  DummyDeserializer mockDeser = mock(DummyDeserializer.class);
  when(mockDeser.deserialize("foo")).thenThrow(new RuntimeException("unexpected"));
  DeserializerProcessor deser = new DeserializerProcessor(mockDeser);
  /*
   * Mock the Stat object
   */
  Stat runtimeStat = mock(Stat.class);
  Stat successStat = mock(Stat.class);
  Stat errorStat = mock(Stat.class);
  deser.setRuntimeStat(runtimeStat);
  deser.setSuccessCountStat(successStat);
  deser.setErrorCountStat(errorStat);
  try {
    deser.deserialize("foo");
  } catch (DeserializationException e) {
    // expected
  }
}