public static int task4() {
      int largest = 0;
      for (int i = 999; i >= 100; i--) {
        for (int j = 999; j >= 100; j--) {
            final int product = i * j;
            if ((product > largest) && (validPalindrome(product))) {
                largest = product;
            } 
         }
      } 
      return largest;
   }