private void dispose(Collection<?> elements) {
        // Dispose all disposable elements
        for (Object element : elements) {
            if (element instanceof Disposable) {
                ((Disposable) element).dispose();
            }
        }

        // Clear collection
        dataProviders.clear();
    }
private void dispose ( Collection < ? > elements ) { for ( Object element : elements ) { if ( element instanceof Disposable ) { ( ( Disposable ) element ) . dispose ( ) ; } } dataProviders . clear ( ) ; }
Clears all elements from the specified collection.

@param elements Collection of elements to be disposed (for instance, data providers, rules, result handlers).