Java : Mismatch in count after Parsing the files
<p>I am Parsing two Files and from each line taking a Particular token and storing them in two  ArrayLists  . (So i have two different ArrayLists containing list of tokens  of each file )</p>

<p>Some part of code to represent the above is </p>

<pre><code>while (!reader.isEOF()) {
String line = reader.readLine();
String[] tokens= line.split("\\|", _LIST.length);
String valuesfromfile = tokens[2];
list.add(valuesfromfile);
}
</code></pre>

<p><strong>similarly parsing the second file</strong> </p>

<pre><code>while (!reader.isEOF()) {
list2.add(valuesfromfile);
}

List&lt;String&gt; firstFileList = t.getList();
List&lt;String&gt; secondFileList = t2.getList();
</code></pre>

<p><strong>After completing this processing i am printing the List sizes of both files</strong></p>

<p><strong>List From First File :firstFileList.size ==76064</strong></p>

<p><strong>List From Second  File :secondFileList.size ==24427</strong></p>

<p>After this , i am comparing both the ArraYlists and printing existing values and new values from both the files this way</p>

<pre><code>ArrayList&lt;String&gt; existingvaluesarrayList = new ArrayList&lt;String&gt;();          
ArrayList&lt;String&gt; newvaluesarraylist = new ArrayList&lt;String&gt;();  


            for (String item : secondFileList) {
                if (firstFileList.contains(item)) {
                    existingvaluesarrayList.add(item);
                } else {
                    newvaluesarraylist.add(item);
                }
            }
</code></pre>

<p>When i printed the existing and new values arraylist the result is this </p>

<p><strong>existingvaluesarrayList  Size ==22820</strong>
*<em>newvaluesarraylist SIZE == 1622</em>*</p>

<p><strong>The Final output is</strong> </p>

<p><strong>List From First File :firstFileList.size ==76064</strong></p>

<p><strong>List From Second  File :secondFileList.size ==24427</strong></p>

<p><strong>existingvaluesarrayList  Size ==22820</strong></p>

<p><strong>newvaluesarraylist SIZE == 1622</strong></p>

<p><strong>I am confused here , when the count is not matching with i combine the 22820 + 1622 with the total list ??</strong></p>
