public T insertWithOverflow(T element) {if (size < maxSize) {add(element);return null;} else if (size > 0 && !lessThan(element, heap[1])) {T ret = heap[1];heap[1] = element;updateTop();return ret;} else {return element;}}
public virtual T InsertWithOverflow(T element){if (size < maxSize){Add(element);return default(T);}else if (size > 0 && !LessThan(element, heap[1])){T ret = heap[1];heap[1] = element;UpdateTop();return ret;}else{return element;}}