Simulation implements Runnable, TaskListener, Cancellable { public double getProgress() { return isDone() ? 1.0d : (finishedCount.doubleValue() / (double) testCaseCount); } Simulation(SupplyChain supplyChain, int testCaseCount, String id); boolean isDone(); double getProgress(); SimulationResult getResult(); ProgressContributor getProgressContributor(); @Override void run(); @Override void taskFinished(org.openide.util.Task task); @Override boolean cancel();  }
@Test public void testGetProgress() { double progress = simulation.getProgress(); Assert.assertEquals(0, progress, 0.000001); }