public T[] toArray(final Class<T> arrayClass) {
        //the following seems to be the only way to keep warning messages away...
        final T[] newArray = (T[]) Array.newInstance(arrayClass, getCollectionForRead().size());
        int idx = 0;
        for (final Object e : getCollectionForRead()) {
            newArray[idx++] = (T) e;
        }
        return newArray;
    }
convenient function to convert to array
<br>
Implementation Note: explicit type parameter 'arrayClass' is necessary,
otherwise returned array might be of type Object[] instead ot T[].
main/src/main/java/cgeo/geocaching/utils/CollectionStream.java