### Question:
AbstractChannel extends DefaultAttributeMap implements Channel { @Override public ChannelPipeline pipeline() { return pipeline; } protected  AbstractChannel(Channel parent); protected  AbstractChannel(Channel parent, ChannelId id); @Override final ChannelId id(); @Override Unsafe unsafe(); @Override ChannelPipeline pipeline(); @Override Channel parent(); @Override EventLoop eventLoop(); @Override ChannelFuture bind(SocketAddress localAddress); @Override ChannelFuture bind(SocketAddress localAddress, ChannelPromise promise); @Override ChannelFuture connect(SocketAddress remoteAddress); @Override ChannelFuture connect(SocketAddress remoteAddress, SocketAddress localAddress); @Override ChannelFuture close(); @Override ChannelFuture connect(SocketAddress remoteAddress, ChannelPromise promise); @Override ChannelFuture connect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise); @Override Channel read(); @Override ChannelFuture write(Object msg); @Override ChannelFuture write(Object msg, ChannelPromise promise); @Override ChannelFuture writeAndFlush(Object msg); @Override ChannelFuture writeAndFlush(Object msg, ChannelPromise promise); @Override Channel flush(); @Override ChannelFuture deregister(); @Override ChannelFuture deregister(ChannelPromise promise); @Override ChannelFuture disconnect(); @Override ChannelFuture disconnect(ChannelPromise promise); @Override ChannelFuture close(ChannelPromise promise); @Override ChannelPromise newPromise(); @Override ChannelProgressivePromise newProgressivePromise(); @Override ChannelFuture newSucceededFuture(); @Override ChannelFuture newFailedFuture(Throwable cause); @Override boolean isWritable(); @Override long bytesBeforeUnwritable(); @Override long bytesBeforeWritable(); @Override boolean isRegistered(); @Override ByteBufAllocator alloc(); @Override SocketAddress localAddress(); @Override SocketAddress remoteAddress(); @Override ChannelFuture closeFuture(); @Override final ChannelPromise voidPromise(); @Override final int hashCode(); @Override final boolean equals(Object o); @Override final int compareTo(Channel o); @Override String toString();  }### Answer:
@Test public void ensureInitialRegistrationFiresActive() throws Throwable { EventLoop eventLoop = mock(EventLoop.class); when(eventLoop.inEventLoop()).thenReturn(true); TestChannel channel = new TestChannel(); ChannelInboundHandler handler = mock(ChannelInboundHandler.class); channel.pipeline().addLast(handler); registerChannel(eventLoop, channel); verify(handler).handlerAdded(any(ChannelHandlerContext.class)); verify(handler).channelRegistered(any(ChannelHandlerContext.class)); verify(handler).channelActive(any(ChannelHandlerContext.class)); }