comparison if statment should be called twice but it is only called once when comparing an Integer
<p>I have a function that takes a Integer array and a boolean array.  If the value in the Integer array is the highest value and the boolean array is true, the value in the trackerArray is set to true.  This is a simplified version of my code that produces the error...</p>

<pre><code>package com.thisis.a.test;

public class ThisIsATest {

    public static void main(String[] args){
        Integer[] integerArray = new Integer[]{75,200,75,200,75};
        boolean[] booleanArray = new boolean[]{false,true,false,true,false};
        boolean[] trackerArray   = new boolean[]{false,false,false,false,false};

        Integer iHighestSum = 0;
        for(int c = 0; c &lt; booleanArray.length; c++){
            if(booleanArray[c] == true)
                if(integerArray[c] &gt; iHighestSum)
                    iHighestSum = integerArray[c];
        }

        for(int c = 0; c &lt; booleanArray.length; c++){
            if(booleanArray[c] == true)
                if(integerArray[c] == iHighestSum) 
                    trackerArray[c] = true; // this if statement should be called twice
        }

        // trackerArray should be {false,true,false,true,false} 
        // instead it is {false,true,false,false,false}
    }
}
</code></pre>

<p>The trackerArray should be {false,true,false,true,false}, instead it is {false,true,false,false,false}.  The if statment should be triggered twice but instead it is only triggered once.  Why is this?</p>
