Is it because in case the files have more lines than 6 it won't work?
if (counterFile1 == 6){
                while (true) {
                    if (LinesFile1.get(counterFile1).equals(LinesFile2.get(counterFile2))) {
                        lines.add(new LineItem(Type.SAME, LinesFile2.get(counterFile2)));
                        counterFile2++;
                    } else {
                        lines.add(new LineItem(Type.ADDED, LinesFile2.get(counterFile2)));
                        counterFile2++;
                        if (counterFile1 == LinesFile1.size()) break;
                    }
                    if ( counterFile2 == LinesFile2.size()) break;
                }
            }