package org.xnio.netty.transport;

import io.netty.bootstrap.Bootstrap;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.buffer.ByteBufAllocator;
import io.netty.testsuite.transport.TestsuitePermutation;
import org.xnio.ByteBufferSlicePool;
import org.xnio.netty.buffer.XnioByteBufAllocator;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 *
 * @author <a href="mailto:nmaurer@redhat.com">Norman Maurer</a>
 */
public final class XnioTestsuiteUtils {
    static List<ByteBufAllocator> newAllocators(List<ByteBufAllocator> allocs) {
        List<ByteBufAllocator> allocators = new ArrayList<>(allocs);
        allocators.add(new XnioByteBufAllocator(new ByteBufferSlicePool(1024 * 16, 1024 * 32)));
        return allocators;
    }

    static List<TestsuitePermutation.BootstrapComboFactory<ServerBootstrap, Bootstrap>> newFactories() {
        return Collections.<TestsuitePermutation.BootstrapComboFactory<ServerBootstrap, Bootstrap>>singletonList(
                new TestsuitePermutation.BootstrapComboFactory<ServerBootstrap, Bootstrap>() {
                    @Override
                    public ServerBootstrap newServerInstance() {
                        try {
                            return new ServerBootstrap().channel(XnioServerSocketChannel.class).group(new XnioEventLoopGroup());
                        } catch (IOException e) {
                            throw new RuntimeException(e);
                        }
                    }

                    @Override
                    public Bootstrap newClientInstance() {
                        try {
                            return new Bootstrap().channel(XnioSocketChannel.class).group(new XnioEventLoopGroup());
                        } catch (IOException e) {
                            throw new RuntimeException(e);
                        }
                    }
                });
    }

    private XnioTestsuiteUtils() {
        // utility
    }
}

@@ -1,8 +1,635 @@
+/*%0A * Copyright 2014 Red Hat, Inc.%0A *%0A * Red Hat licenses this file to you under the Apache License, version 2.0%0A * (the %22License%22); you may not use this file except in compliance with the%0A * License.  You may obtain a copy of the License at:%0A *%0A *    http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the%0A * License for the specific language governing permissions and limitations%0A * under the License.%0A *%0A */%0A
 package 
@@ -1109,23 +1109,16 @@
 /a%3E%0A */%0A
-public 
 final cl

Add missing license header