code: public static InterceptorFactory getChainedInterceptorFactory(Collection<InterceptorFactory> instances) {
          final int size = instances.size();
          return size == 1 ? instances.iterator().next() : new ChainedInterceptorFactory(instances.toArray(InterceptorFactory.EMPTY_ARRAY));
      }
docs: Get a chained interceptor which passes the invocation through the given interceptors.
  
  @param instances the interceptors to pass through
  @return the chained interceptor