Java Create Array With Range Of A Function