### Question:
DefaultHttp2ConnectionEncoder implements Http2ConnectionEncoder, Http2SettingsReceivedConsumer { @Override public ChannelFuture writeGoAway( final ChannelHandlerContext ctx, final int lastStreamId, final long errorCode, final ByteBuf debugData, final ChannelPromise promise) { return lifecycleManager.goAway(ctx, lastStreamId, errorCode, debugData, promise); } DefaultHttp2ConnectionEncoder(
      final Http2Connection connection, final Http2FrameWriter frameWriter); @Override void lifecycleManager(final Http2LifecycleManager lifecycleManager); @Override Http2FrameWriter frameWriter(); @Override Http2Connection connection(); @Override final Http2RemoteFlowController flowController(); @Override void remoteSettings(final Http2Settings settings); @Override ChannelFuture writeData(
      final ChannelHandlerContext ctx,
      final int streamId,
      final ByteBuf data,
      final int padding,
      final boolean endOfStream,
      final ChannelPromise promise); @Override ChannelFuture writeHeaders(
      final ChannelHandlerContext ctx,
      final int streamId,
      final Http2Headers headers,
      final int padding,
      final boolean endStream,
      final ChannelPromise promise); @Override ChannelFuture writeHeaders(
      final ChannelHandlerContext ctx,
      final int streamId,
      final Http2Headers headers,
      final int streamDependency,
      final short weight,
      final boolean exclusive,
      final int padding,
      final boolean endOfStream,
      @SuppressWarnings("checkstyle:finalparameters") ChannelPromise promise); @Override ChannelFuture writePriority(
      final ChannelHandlerContext ctx,
      final int streamId,
      final int streamDependency,
      final short weight,
      final boolean exclusive,
      final ChannelPromise promise); @Override ChannelFuture writeRstStream(
      final ChannelHandlerContext ctx,
      final int streamId,
      final long errorCode,
      final ChannelPromise promise); @Override ChannelFuture writeSettings(
      final ChannelHandlerContext ctx, final Http2Settings settings, final ChannelPromise promise); @Override ChannelFuture writeSettingsAck(
      final ChannelHandlerContext ctx, final ChannelPromise promise); @Override ChannelFuture writePing(
      final ChannelHandlerContext ctx,
      final boolean ack,
      final long data,
      final ChannelPromise promise); @Override ChannelFuture writePushPromise(
      final ChannelHandlerContext ctx,
      final int streamId,
      final int promisedStreamId,
      final Http2Headers headers,
      final int padding,
      ChannelPromise promise); @Override ChannelFuture writeGoAway(
      final ChannelHandlerContext ctx,
      final int lastStreamId,
      final long errorCode,
      final ByteBuf debugData,
      final ChannelPromise promise); @Override ChannelFuture writeWindowUpdate(
      final ChannelHandlerContext ctx,
      final int streamId,
      final int windowSizeIncrement,
      final ChannelPromise promise); @Override ChannelFuture writeFrame(
      final ChannelHandlerContext ctx,
      final byte frameType,
      final int streamId,
      final Http2Flags flags,
      final ByteBuf payload,
      final ChannelPromise promise); @Override void close(); @Override Http2Settings pollSentSettings(); @Override Configuration configuration(); @Override void consumeReceivedSettings(final Http2Settings settings);  }### Answer:
@Test public void encoderDelegatesGoAwayToLifeCycleManager() { final ChannelPromise promise = newPromise(); encoder.writeGoAway(ctx, STREAM_ID, Http2Error.INTERNAL_ERROR.code(), null, promise); verify(lifecycleManager) .goAway( eq(ctx), eq(STREAM_ID), eq(Http2Error.INTERNAL_ERROR.code()), eq((ByteBuf) null), eq(promise)); verifyNoMoreInteractions(writer); }