### Question:
EvaluatorExecutor implements Runnable { @Override public final void run() { long itemId = getContext().getItemId(); try { execute(); } finally { executorServiceWithRegistry.finished(this, itemId); } }  @Nonnull abstract EvaluatorContext getContext(); abstract String getName(); abstract void setContext(EvaluatorContext context); @Override final void run();  }### Answer:
@Test public void testRunCallsFinished() { underTest.run(); verify(executorServiceWithRegistry).finished(any(), anyLong()); }
@Test public void testRunCallsFinishedWhenThrows() { underTest.setExceptionForExecute(true); try { underTest.run(); fail("expected exception"); } catch (RuntimeException e) { } verify(executorServiceWithRegistry).finished(any(), anyLong()); }