The following condition is not met even though the program runs correctly. The displayClosestToTen method should display a number on the screen in accordance with the task conditions.
public static void displayClosestToTen(int a, int b) {
        // write your code here
        int a1 = abs(a - 10);
        int b1 = abs(b - 10);
        if (a1 > b1) {
            System.out.println(b);
        } else if (a1 < b1){
            System.out.println(a);
        } else {
            System.out.println(a + " " + b);
        }

    }