### Question:
JobEntryJobRunner implements Runnable { public boolean isFinished() { return finished; } JobEntryJobRunner( Job job, Result result, int entryNr, LogChannelInterface log ); void run(); void setResult( Result result ); Result getResult(); LogChannelInterface getLog(); void setLog( LogChannelInterface log ); Job getJob(); void setJob( Job job ); int getEntryNr(); void setEntryNr( int entryNr ); boolean isFinished(); void waitUntilFinished();  }### Answer:
@Test public void testIsFinished() throws Exception { assertFalse( jobRunner.isFinished() ); when( mockJob.isStopped() ).thenReturn( false ); when( mockJob.getParentJob() ).thenReturn( parentJob ); when( parentJob.isStopped() ).thenReturn( false ); when( mockJob.execute( Mockito.anyInt(), Mockito.any( Result.class ) ) ).thenReturn( mockResult ); jobRunner.run(); assertTrue( jobRunner.isFinished() ); }