@Test
public void testSetStreamEndPlugin() throws InterruptedException {

  StreamMonitor streamMonitor = mock(StreamMonitor.class);
  UdpStreamProcessor udpStreamProcessor =
      new UdpStreamProcessor(streamMonitor, mockBundleContext);
  RolloverCondition rolloverCondition = mock(RolloverCondition.class);
  when(rolloverCondition.isRolloverReady(any())).thenReturn(true);
  StreamEndPlugin streamEndPlugin = mock(StreamEndPlugin.class);
  udpStreamProcessor.setStreamEndPlugin(streamEndPlugin);
  udpStreamProcessor.setRolloverCondition(rolloverCondition);
  udpStreamProcessor.setRolloverAction(mock(RolloverAction.class));
  udpStreamProcessor.getPacketBuffer().write(new byte[] {0x00});
  Thread.sleep(1000);
  udpStreamProcessor.checkForRollover();
  verify(streamEndPlugin).streamEnded(any());
}