import java.util.ArrayList;
import java.util.List;

public class Main {
    // Our limit
    private final static int limit = 4000000;
    private static List<Integer> fibSeq;

    public Main() {

    }

    // Method for iterative calculation of the Fibonacci seq.
    public static void fib() {
        // Init the array
        fibSeq = new ArrayList();
        // Define var to store our terms (start from 1)
        int first = 1, second = 2;
        fibSeq.add(first);
        fibSeq.add(second);
        for (int i = 1; ; i++) {
            int savePrev1 = first;
            first = second;
            second = savePrev1 + second;
            // Condition from email
            if (second >= limit) {
                break;
            } else {
                fibSeq.add(second);
            }
            // For testing
            //System.out.println(fibSeq);
        }
    }

    // Method to count sum of the even-valued terms
    public static int sumOfEven(List<Integer> sequences) {
        int sum = 0;
        for (int i : sequences) {
            if (i % 2 == 0) {
                sum += i;
            }
        }
        return sum;
    }

    public static void main(String[] args) {
        fib();
        int sumOf = sumOfEven(fibSeq);
        System.out.println("Sum of the even numbers in sequence= " + sumOf);

    }
}

@@ -111,21 +111,21 @@
 tic int 
-limit
+LIMIT
  = 40000
@@ -131,77 +131,8 @@
 000;
-%0A    private static List%3CInteger%3E fibSeq;%0A%0A    public Main() %7B%0A%0A    %7D
 %0A%0A  
@@ -206,61 +206,60 @@
 lic 
-static void fib() %7B%0A        // Init the array%0A       
+List%3CInteger%3E fib(int limit) %7B%0A        List%3CInteger%3E
  fib
@@ -362,9 +362,21 @@
  = 1
-,
+;%0A        int
  sec
@@ -496,17 +496,20 @@
 savePrev
-1
+Term
  = first
@@ -567,17 +567,20 @@
 savePrev
-1
+Term
  + secon
@@ -774,16 +774,18 @@
 testing%0A
+//
         
@@ -788,18 +788,16 @@
         
-//
 System.o
@@ -805,32 +805,39 @@
 t.println(fibSeq
+.size()
 );%0A        %7D%0A   
@@ -829,24 +829,47 @@
 ;%0A        %7D%0A
+        return fibSeq;%0A
     %7D%0A%0A    /
@@ -926,23 +926,16 @@
  public 
-static 
 int sumO
@@ -1182,20 +1182,86 @@
         
-fib(
+Main fibonaci = new Main();%0A        List sequence = fibonaci.fib(LIMIT
 );%0A     
@@ -1275,16 +1275,25 @@
 sumOf = 
+fibonaci.
 sumOfEve
@@ -1294,22 +1294,24 @@
 mOfEven(
-fibSeq
+sequence
 );%0A     
@@ -1382,17 +1382,16 @@
 sumOf);%0A
-%0A
     %7D%0A%7D%0A

Clean Up