public ProductFactoryCascade < T > addFactoryBefore ( ProductFactory < ? extends T > factory ) { ArrayList < ProductFactory < ? extends T > > factories = new ArrayList < ProductFactory < ? extends T > > ( this . factories . size ( ) + 1 ) ; factories . addAll ( this . factories ) ; factories . add ( 0 , factory ) ; return new ProductFactoryCascade <> ( factories ) ; }
Add a given factory to the list of factories at the BEGINNING .