public boolean checkDuplicate(T obj)
    {
        int top = _top.get();

        for (int i = top - 1; i >= 0; i--) {
            if (_freeStack.get(i) == obj)
                return true;
        }

        return false;
    }
public boolean checkDuplicate ( T obj ) { int top = _top . get ( ) ; for ( int i = top - 1 ; i >= 0 ; i -- ) { if ( _freeStack . get ( i ) == obj ) return true ; } return false ; }
Debugging to see if the object has already been freed.