public boolean append(E element) {

        if (lastPos == array.length - 1 || array.length == 0) {
            changeCapacityBy(1);
            if (array.length == 1) {
                return setElement(0, element);
            }
        }
        if (array.length > 0 && lastPos == 0 && array[lastPos] == null) {
            return setElement(lastPos, element);
        }
        return setElement(++lastPos, element);
    }