### Question:
DutyQueue { public void onAttestationCreationDue(final UInt64 slot) { execute(duties -> duties.produceAttestations(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 onAttestationProductionDue_shouldActImmediatelyIfDutiesLoaded() { scheduledDutiesFuture.complete(scheduledDuties); duties.onAttestationCreationDue(ONE); verify(scheduledDuties).produceAttestations(ONE); }
@Test public void onAttestationProductionDue_shouldDeferUntilDutiesLoaded() { duties.onAttestationCreationDue(ONE); verifyNoInteractions(scheduledDuties); scheduledDutiesFuture.complete(scheduledDuties); verify(scheduledDuties).produceAttestations(ONE); }