@Test
public void testDetectIDR() throws Exception {

  List<NALUnit> nalUnitList = new LinkedList<>();
  NALUnit nalUnit = new NALUnit(NALUnitType.IDR_SLICE, 0);
  nalUnitList.add(nalUnit);
  Mpeg4DecodedStreamData decodedStreamData = mock(Mpeg4DecodedStreamData.class);
  when(decodedStreamData.getNalUnits()).thenReturn(nalUnitList);
  doCallRealMethod().when(decodedStreamData).accept(any());
  EmbeddedChannel channel = new EmbeddedChannel(new DecodedStreamDataHandler(packetBuffer));
  channel.writeInbound(decodedStreamData);
  verify(packetBuffer).frameComplete(PacketBuffer.FrameType.IDR);
}