// Path: hppc/src/main/templates/com/carrotsearch/hppc/cursors/KTypeCursor.java
// public final class KTypeCursor<KType> {
//   /**
//    * The current value's index in the container this cursor belongs to. The
//    * meaning of this index is defined by the container (usually it will be an
//    * index in the underlying storage buffer).
//    */
//   public int index;
// 
//   /**
//    * The current value.
//    */
//   public KType value;
// 
//   @Override
//   public String toString() {
//     return "[cursor, index: " + index + ", value: " + value + "]";
//   }
// }


import java.util.Arrays;
import com.carrotsearch.hppc.cursors.KTypeCursor;

    ensureBufferSpace(len);
    System.arraycopy(elements, start, buffer, elementsCount, len);
    elementsCount += len;
  }

  /**
   * Vararg-signature method for pushing elements at the top of the stack.
   * <p>
   * <b>This method is handy, but costly if used in tight loops (anonymous array
   * passing)</b>
   * </p>
   */
  /* #if ($TemplateOptions.KTypeGeneric) */
  @SafeVarargs
  /* #end */
  public final void push(KType... elements) {
    push(elements, 0, elements.length);
  }

  /**
   * Pushes all elements from another container to the top of the stack.
   */
  public int pushAll(KTypeContainer<? extends KType> container) {
    return addAll(container);
  }

  /**
   * Pushes all elements from another iterable to the top of the stack.
   */
// Path: hppc/src/main/templates/com/carrotsearch/hppc/cursors/KTypeCursor.java
// public final class KTypeCursor<KType> {
//   /**
//    * The current value's index in the container this cursor belongs to. The
//    * meaning of this index is defined by the container (usually it will be an
//    * index in the underlying storage buffer).
//    */
//   public int index;
// 
//   /**
//    * The current value.
//    */
//   public KType value;
// 
//   @Override
//   public String toString() {
//     return "[cursor, index: " + index + ", value: " + value + "]";
//   }
// }


// Path: hppc/src/main/templates/com/carrotsearch/hppc/KTypeStack.java
import java.util.Arrays;
import com.carrotsearch.hppc.cursors.KTypeCursor;


    ensureBufferSpace(len);
    System.arraycopy(elements, start, buffer, elementsCount, len);
    elementsCount += len;
  }

  /**
   * Vararg-signature method for pushing elements at the top of the stack.
   * <p>
   * <b>This method is handy, but costly if used in tight loops (anonymous array
   * passing)</b>
   * </p>
   */
  /* #if ($TemplateOptions.KTypeGeneric) */
  @SafeVarargs
  /* #end */
  public final void push(KType... elements) {
    push(elements, 0, elements.length);
  }

  /**
   * Pushes all elements from another container to the top of the stack.
   */
  public int pushAll(KTypeContainer<? extends KType> container) {
    return addAll(container);
  }

  /**
   * Pushes all elements from another iterable to the top of the stack.
   */
  public int pushAll(Iterable<? extends KTypeCursor<? extends KType>> iterable) {