这里为啥报红线?该如何修改?

完整代码:
package test;
import java.util.Arrays;
public class test {
public static void main(String[] args) {
int[] ans = {3, 4, 5, 7, 8, 10};
Arrays.sort(ans, new Comparator(){
@Override
public int compare(Object o1, Object o2) {
int i1 = (Integer) o1;//拆箱
int i2 = (Integer) o2;
return i1 - i2;
}
}));
}
public void bubbleSort(int[] ans, Comparator c) {
for (int i = 0; i < ans.length - 1; i++) {
for (int j = 0; j < ans.length - i - 1; j++) {
if (c.compare(ans[j], ans[j + 1]) > 0) {
int temp = ans[j];
ans[j] = ans[j + 1];
ans[j + 1] = temp;
}
}
}
}
public static interface Comparator {
public int compare (Object o1, Object o2) ;
}
}