### Question:
PacketArrivalEvent extends Event { @Override public void trigger() { arrivalNetworkDevice.receive(packet); } PacketArrivalEvent(long timeFromNowNs, Packet packet, NetworkDevice arrivalNetworkDevice); @Override void trigger(); @Override String toString();  }### Answer:
@Test public void testTriggerIsolated() { NetworkDevice networkDevice = mock(NetworkDevice.class); PacketArrivalEvent event = new PacketArrivalEvent(1000, packet, networkDevice); event.trigger(); verify(networkDevice, times(1)).receive(packet); }