@Test
  public void testGetUnfinishedAllocations_singleThread() {
    AllocationCompletionTracker allocationCompletionTracker = new AllocationCompletionTracker();

    Assert.assertTrue(allocationCompletionTracker.updateProgress(AllocationTree.root, 0L));
    Assert.assertEquals(
        Collections.singletonList(AllocationTree.root),
        allocationCompletionTracker.getUnfinishedAllocations());

    Assert.assertTrue(allocationCompletionTracker.updateProgress(AllocationTree.child1, 0L));
    Assert.assertEquals(
        Arrays.asList(AllocationTree.root, AllocationTree.child1),
        allocationCompletionTracker.getUnfinishedAllocations());

    Assert.assertTrue(allocationCompletionTracker.updateProgress(AllocationTree.child1Child, 0L));
    Assert.assertEquals(
        Arrays.asList(AllocationTree.root, AllocationTree.child1, AllocationTree.child1Child),
        allocationCompletionTracker.getUnfinishedAllocations());

    Assert.assertTrue(allocationCompletionTracker.updateProgress(AllocationTree.child1Child, 50L));
    Assert.assertEquals(
        Arrays.asList(AllocationTree.root, AllocationTree.child1, AllocationTree.child1Child),
        allocationCompletionTracker.getUnfinishedAllocations());

    Assert.assertTrue(allocationCompletionTracker.updateProgress(AllocationTree.child1Child, 50L));
    Assert.assertEquals(
        Collections.singletonList(AllocationTree.root),
        allocationCompletionTracker.getUnfinishedAllocations());

    Assert.assertTrue(allocationCompletionTracker.updateProgress(AllocationTree.child2, 100L));
    Assert.assertEquals(
        Arrays.asList(AllocationTree.root, AllocationTree.child2),
        allocationCompletionTracker.getUnfinishedAllocations());

    Assert.assertTrue(allocationCompletionTracker.updateProgress(AllocationTree.child2, 100L));
    Assert.assertEquals(
        Collections.emptyList(), allocationCompletionTracker.getUnfinishedAllocations());

    Assert.assertFalse(allocationCompletionTracker.updateProgress(AllocationTree.child2, 0L));
    Assert.assertEquals(
        Collections.emptyList(), allocationCompletionTracker.getUnfinishedAllocations());

    try {
      allocationCompletionTracker.updateProgress(AllocationTree.child1, 1L);
      Assert.fail();

    } catch (IllegalStateException ex) {
      Assert.assertEquals("Progress exceeds max for 'child1': 1 more beyond 1", ex.getMessage());
    }
  }
Second child of the root node.
jib-core/src/test/java/com/google/cloud/tools/jib/event/progress/AllocationCompletionTrackerTest.java