### Question:
DutyQueue { public void onBlockProductionDue(final UInt64 slot) { execute(duties -> duties.produceBlock(slot)); } DutyQueue(final SafeFuture<ScheduledDuties> futureDuties); void onBlockProductionDue(final UInt64 slot); void onAttestationCreationDue(final UInt64 slot); void onAttestationAggregationDue(final UInt64 slot); int countDuties(); synchronized void cancel();  }### Answer:
@Test public void onBlockProductionDue_shouldActImmediatelyIfDutiesLoaded() { scheduledDutiesFuture.complete(scheduledDuties); duties.onBlockProductionDue(ONE); verify(scheduledDuties).produceBlock(ONE); }
@Test public void onBlockProductionDue_shouldDeferUntilDutiesLoaded() { duties.onBlockProductionDue(ONE); verifyNoInteractions(scheduledDuties); scheduledDutiesFuture.complete(scheduledDuties); verify(scheduledDuties).produceBlock(ONE); }