code: public void discard(int count) {
      assert elementsCount >= count;
  
      elementsCount -= count;
      /* #if ($TemplateOptions.KTypeGeneric) */
      Arrays.fill(buffer, elementsCount, elementsCount + count, null);
      /* #end */
    }
docs: Discard an arbitrary number of elements from the top of the stack.