Http2GoAwayHandler { @VisibleForTesting static boolean isExpected(long errorCode, ByteBuf debugData) { return errorCode == CODE_INTERNAL_ERROR && ByteBufUtil.equals(debugData, debugData.readerIndex(), ERROR_FLUSHING, 0, ERROR_FLUSHING_LEN); }  boolean sentGoAway(); boolean receivedGoAway(); boolean receivedErrorGoAway(); void onGoAwaySent(Channel channel, int lastStreamId, long errorCode, ByteBuf debugData); void onGoAwayReceived(Channel channel, int lastStreamId, long errorCode, ByteBuf debugData); void onStreamClosed(Channel channel, Http2Stream stream);  }
@Test void testIsExpected() { final ByteBuf errorFlushing = Unpooled.copiedBuffer("Error flushing", StandardCharsets.UTF_8); final ByteBuf errorFlushing2 = Unpooled.copiedBuffer("Error flushing stream", StandardCharsets.UTF_8); final ByteBuf other = Unpooled.copiedBuffer("Other reasons", StandardCharsets.UTF_8); assertThat(isExpected(Http2Error.INTERNAL_ERROR.code(), errorFlushing)).isTrue(); assertThat(isExpected(Http2Error.PROTOCOL_ERROR.code(), errorFlushing)).isFalse(); assertThat(isExpected(Http2Error.INTERNAL_ERROR.code(), errorFlushing2)).isTrue(); assertThat(isExpected(Http2Error.INTERNAL_ERROR.code(), other)).isFalse(); }