@Override
        public RoutingPolicy create(String param) {
            return new RoutingPolicy() {

                @Override
                public void select(RoutingContext context) {
                    if (selectRoute != null) {
                        context.addChild(selectRoute);
                    }
                    if (selectReply != null) {
                        context.setReply(selectReply);
                    }
                    if (selectException != null) {
                        throw selectException;
                    }
                }

                @Override
                public void merge(RoutingContext context) {
                    if (mergeReply != null) {
                        context.setReply(mergeReply);
                    } else if (mergeFromChild) {
                        context.setReply(context.getChildIterator().removeReply());
                    }
                    if (mergeException != null) {
                        throw mergeException;
                    }
                }

                @Override
                public void destroy() {

                }
            };
        }
@author havardpe
@author Simon Thoresen Hult
messagebus/src/test/java/com/yahoo/messagebus/routing/RoutingTestCase.java