class AbstractObjectPool<T> implements ObjectPool<T> {

    /**
     * Returns the object to the pool.
     * The method first validates the object if it is
     * re-usable and then puts returns it to the pool.
     *
     * If the object validation fails,
     * {@link #handleInvalidReturn(java.lang.Object)} is called.
     * Some implementations
     * will try to create a new object
     * and put it into the pool; however
     * this behaviour is subject to change
     * from implementation to implementation.
     */
    public final void release(T t) {<FILL_FUNCTION_BODY>}

    protected abstract void handleInvalidReturn(T t);

    protected abstract void returnToPool(T t);

    protected abstract boolean isValid(T t);
}

        if (isValid(t)) {
            returnToPool(t);
        } else {
            handleInvalidReturn(t);
        }
    
<no_super_class>