@SuppressWarnings("unchecked")
    public ThreadLocalStackReference<T> pushConditionally(T item, boolean condition) {
        if (condition) {
            return push(item);
        } else {
            return (ThreadLocalStackReference<T>) NULL_REFERENCE;
        }
    }
@ SuppressWarnings ( "unchecked" ) public ThreadLocalStackReference < T > pushConditionally ( T item , boolean condition ) { if ( condition ) { return push ( item ) ; } else { return ( ThreadLocalStackReference < T > ) NULL_REFERENCE ; } }
Convenience method which only pushes something to stack if the condition evaluates to true. If the condition evaluates to true, this method behaves the same as {@link #push(Object)}.
Otherwise, a special null {@link ThreadLocalStackReference} object is returned. {@link ThreadLocalStackReference#pop()} may
be called on the returned object - it will not have any effect and always return null.