### Question:
UniqueMessageMulticaster implements ValidatorMulticaster { @Override public void send(final MessageData message) { send(message, Collections.emptyList()); } UniqueMessageMulticaster(
      final ValidatorMulticaster multicaster, final int gossipHistoryLimit); @VisibleForTesting  UniqueMessageMulticaster(
      final ValidatorMulticaster multicaster, final MessageTracker gossipedMessageTracker); @Override void send(final MessageData message); @Override void send(final MessageData message, final Collection<Address> denylist);  }### Answer:
@Test public void previouslySentMessageIsNotSentAgain() { when(messageTracker.hasSeenMessage(messageSent)).thenReturn(false); uniqueMessageMulticaster.send(messageSent); verify(multicaster, times(1)).send(messageSent, emptyList()); reset(multicaster); when(messageTracker.hasSeenMessage(messageSent)).thenReturn(true); uniqueMessageMulticaster.send(messageSent); uniqueMessageMulticaster.send(messageSent, emptyList()); verifyZeroInteractions(multicaster); }
@Test public void messagesSentWithADenylistAreNotRetransmitted() { when(messageTracker.hasSeenMessage(messageSent)).thenReturn(false); uniqueMessageMulticaster.send(messageSent, emptyList()); verify(multicaster, times(1)).send(messageSent, emptyList()); reset(multicaster); when(messageTracker.hasSeenMessage(messageSent)).thenReturn(true); uniqueMessageMulticaster.send(messageSent, emptyList()); uniqueMessageMulticaster.send(messageSent); verifyZeroInteractions(multicaster); }
@Test public void passedInDenylistIsPassedToUnderlyingValidator() { final List<Address> denylist = Lists.newArrayList(AddressHelpers.ofValue(0), AddressHelpers.ofValue(1)); uniqueMessageMulticaster.send(messageSent, denylist); verify(multicaster, times(1)).send(messageSent, denylist); }