Что не так??
package com.javarush.task.task17.task1721;
import org.w3c.dom.ls.LSOutput;
import java.io.*;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/*
Транзакционность
*/
public class Solution {
public static List<String> allLines = new ArrayList<String>();
public static List<String> forRemoveLines = new ArrayList<String>();
public static String firstFile;
public static String secondFile;
static {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
try {
firstFile = reader.readLine();
secondFile = reader.readLine();
} catch (IOException e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
try {
new Solution().joinData();
} catch (CorruptedDataException e) {
e.printStackTrace();
}
}
public void joinData() throws CorruptedDataException {
List one = readFile(firstFile, allLines);
List two = readFile(secondFile, forRemoveLines);
ArrayList<Integer> list = new ArrayList<>();
int t = 0;
for (int i = 0; i < two.size(); i++) {
for (int j = 0; j < one.size(); j++) {
if (two.get(i).equals(one.get(j))) {
t++;
list.add(j);
}
}
}
int[]lis = new int[list.size()];
for (int i = 0; i < list.size(); i++) {
lis[i] = list.get(i);
}
Arrays.sort(lis);
if (two.size() == t) {
for (int i = list.size()-1; i >= 0; i--) {
one.remove(lis[i]);
}
} else {
one.removeAll(one.subList(0, one.size()));
}
System.out.println(lis);
System.out.println(one);
System.out.println(two);
}
public static List readFile(String nameFile, List arrayList) {
try {
String f;
BufferedReader reader1 = new BufferedReader(new FileReader(nameFile));
while ((f = reader1.readLine()) != null) {
arrayList.add(f);
}
} catch (IOException e) {
e.printStackTrace();
}
return arrayList;
}
}