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