### Question:
StatelessSpspReceiverLink extends AbstractLink<StatelessSpspReceiverLinkSettings> implements Link<StatelessSpspReceiverLinkSettings> { @Override public InterledgerResponsePacket sendPacket(final InterledgerPreparePacket preparePacket) { Objects.requireNonNull(preparePacket, "preparePacket must not be null"); return streamReceiver.receiveMoney(preparePacket, this.getOperatorAddressSupplier().get(), this.denomination) .map(fulfillPacket -> { if (logger.isDebugEnabled()) { logger.debug("Packet fulfilled! preparePacket={} fulfillPacket={}", preparePacket, fulfillPacket); } return fulfillPacket; }, rejectPacket -> { if (logger.isDebugEnabled()) { logger.debug("Packet rejected! preparePacket={} rejectPacket={}", preparePacket, rejectPacket); } return rejectPacket; } ); } StatelessSpspReceiverLink(
      final Supplier<InterledgerAddress> operatorAddressSupplier,
      final StatelessSpspReceiverLinkSettings linkSettings,
      final StreamReceiver streamReceiver
  ); @Override void registerLinkHandler(final LinkHandler ilpDataHandler); @Override InterledgerResponsePacket sendPacket(final InterledgerPreparePacket preparePacket); @Override String toString(); static final String LINK_TYPE_STRING; static final LinkType LINK_TYPE; }### Answer:
@Test(expected = NullPointerException.class) public void sendPacketWithNull() { try { link.sendPacket(null); } catch (NullPointerException e) { assertThat(e.getMessage()).isEqualTo("preparePacket must not be null"); throw e; } }
@Test public void sendPacket() { final InterledgerFulfillPacket actualFulfillPacket = InterledgerFulfillPacket.builder() .fulfillment(ALL_ZEROS_FULFILLMENT) .build(); when(streamReceiverMock.receiveMoney(any(), any(), any())).thenReturn(actualFulfillPacket); final InterledgerPreparePacket preparePacket = preparePacket(); link.sendPacket(preparePacket).handle( fulfillPacket -> { assertThat(fulfillPacket).isEqualTo(actualFulfillPacket); }, rejectPacket -> { logger.error("rejectPacket={}", rejectPacket); fail("Expected a Fulfill"); } ); }