### Question:
Worker implements Runnable { @Override public void run() { LOGGER.info("{} processing {}", Thread.currentThread().getName(), task.toString()); try { Thread.sleep(task.getTimeMs()); } catch (InterruptedException e) { e.printStackTrace(); } } Worker(final Task task); @Override void run();  }### Answer:
@Test public void testRun() { final var task = mock(Task.class); final var worker = new Worker(task); verifyZeroInteractions(task); worker.run(); verify(task).getTimeMs(); verifyNoMoreInteractions(task); }
@Test public void testRun() { final Task task = mock(Task.class); final Worker worker = new Worker(task); verifyZeroInteractions(task); worker.run(); verify(task).getTimeMs(); verifyNoMoreInteractions(task); }