Не проходит последний пункт.
package com.javarush.task.task13.task1326;
/*
Сортировка четных чисел из файла
*/
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
List<Integer> list = new ArrayList<>();
String line = "";
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String file = br.readLine();
FileInputStream fr = new FileInputStream(file);
BufferedReader reader = new BufferedReader(new InputStreamReader(fr));
while (line != null) {
line = reader.readLine();
if (line.isEmpty()) {
} else {
list.add(Integer.parseInt(line));
}
}
br.close();
fr.close();
reader.close();
} catch (FileNotFoundException e) {
} catch (IOException e) {
} catch (NullPointerException e) {
}
int[] x = new int[list.size()];
for (int i = 0; i < x.length; i++) {
x[i] = list.get(i);
}
for (int i = 0; i < x.length; i++) {
for (int j = 0; j < x.length; j++) {
if (x[i] < x[j]) {
int k = x[i];
x[i] = x[j];
x[j] = k;
}
}
}
for (int i = 0; i < x.length; i++) {
if (x[i] % 2 == 0) {
System.out.println(x[i]);
}
}
}
}