public MagicList<E> subList(int startIndex, int endIndex) {
        if (startIndex <0) {
            throw new IllegalArgumentException(
                    "startIndex must not less than zero");
        }
        if (startIndex >= endIndex) {
            throw new IllegalArgumentException(
                    "startIndex must less than end endIndex");
        }
        MagicList<E> result = new MagicList<E>();
        for (int i = startIndex; i < this.size() && i <= endIndex; i++) {
            result.add(this.get(i));
        }
        return result;
    }