import java.util.Arrays;
import java.util.stream.Stream;

class Solution {
    public static void main(String[] args) {
        int[] arr = { 1, 1, 1, 2, 3 };

        int[] result = arr.length >= 2
                ? Stream.iterate(
                            new int[] { arr[0], arr[1] }, 
                            temp -> new int[] { temp[1], temp[0] + temp[1] }
                        )
                        .mapToInt(temp -> temp[1])
                        .limit(arr.length)
                        .toArray()
                : arr;

        System.out.println(Arrays.toString(result));
    }
}