Java Create Array With Range Of A Function Of A Generator