EventLoopGroupFactory { public static EventLoopGroup newEventLoopGroup( int threadCount ) { return new DriverEventLoopGroup( threadCount ); } private  EventLoopGroupFactory(); static Class<? extends Channel> channelClass(); static EventLoopGroup newEventLoopGroup( int threadCount ); static void assertNotInEventLoopThread(); static boolean isEventLoopThread( Thread thread );  }
@Test void shouldCreateEventLoopGroupWithSpecifiedThreadCount() { int threadCount = 2; eventLoopGroup = EventLoopGroupFactory.newEventLoopGroup( threadCount ); assertEquals( threadCount, count( eventLoopGroup ) ); assertThat( eventLoopGroup, instanceOf( NioEventLoopGroup.class ) ); }
@Test void shouldUseSameThreadClassAsNioEventLoopGroupDoesByDefault() throws Exception { NioEventLoopGroup nioEventLoopGroup = new NioEventLoopGroup( 1 ); eventLoopGroup = EventLoopGroupFactory.newEventLoopGroup( 1 ); try { Thread defaultThread = getThread( nioEventLoopGroup ); Thread driverThread = getThread( eventLoopGroup ); assertEquals( defaultThread.getClass(), driverThread.getClass().getSuperclass() ); assertEquals( defaultThread.getPriority(), driverThread.getPriority() ); } finally { shutdown( nioEventLoopGroup ); } }