/** * Adds the given item to the top of the stack if the stack is not empty. */ public void pushIfNotEmpty(E item) { if (!isEmpty()) { push(item); } }
/** * Adds the given item to the top of the stack if the stack is not empty. */ public void pushIfNotEmpty(E item) { if (!isEmpty()) { push(item); } }