class HandlerChainBuilder {

    public List<Handler> sortHandlers(List<Handler> handlers) {

        final int size = handlers.size();
        List<Handler> logicalHandlers = new ArrayList<>(size);
        List<Handler> protocolHandlers = new ArrayList<>(Math.min(10, size));

        for (Handler<?> handler : handlers) {
            if (handler instanceof LogicalHandler) {
                logicalHandlers.add(handler);
            } else {
                protocolHandlers.add(handler);
            }
        }

        if (!protocolHandlers.isEmpty()) {
            logicalHandlers.addAll(protocolHandlers);
        }
        return logicalHandlers;
    }

    public  HandlerChainBuilder(Bus aBus);
    public  HandlerChainBuilder();

}