import java.util.*;

public class XMAS
{
    public XMAS (boolean debug)
    {
        _debug = debug;
    }

    public Vector<Integer> validate (Vector<Integer> input, int preamble)
    {
        Vector<Integer> invalid = new Vector<Integer>();
        int index = 0;

        for (int i = preamble; i < input.size(); i++)
        {
            if (!sums(elementAt(i), input, index, preamble))
                invalid.add(elementAt(i));
            
            index++;
        }

        return invalid;
    }

    private boolean sums (int total, Vector<Integer> input, int start, int preanble)
    {
        for (int j = start; j < (start + preamble -1); j++)
        {
            if (input.elementAt(index) + input.elementAt(index +1) == total)
                return true;
        }

        return false;
    }

    private boolean _debug;
}
@@ -746,16 +746,30 @@
  total)%0A
+            %7B%0A
         
@@ -789,34 +789,154 @@
 n true;%0A        
+   
+ 
 %7D%0A
+        %7D%0A%0A        if (_debug)%0A            System.out.println(total+%22 is not the sum of two entries.%22);%0A            
 %0A        return 

Update XMAS.java