Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; public class Main { public static ArrayList<Integer> resetIncrementalList(ArrayList<Integer> list) { for (int i = 0; i < list.size(); i++) { if (i >= 2) { list.set(i, list.get(i) + list.get(i - 2)); } } return list; } }