cannot find symbol: method ceiling(int)

I can’t understand why I am getting this error despite ceiling and floor functions are present in the TreeSet class. I get following error:

cannot find symbol: method ceiling(int)

Here is my Java code:

 import java.util.Set;
 import java.util.TreeSet;

 public static boolean containsNearbyAlmostDuplicate(int[] nums, int k, int t) {
    Set<Integer> set = new TreeSet<>();
    for (int i = 0; i<nums.length; i++) {
        Integer x = set.(nums[i]);
        if(x!= null && x<= nums[i]+t)
            return true;
        Integer y = set.ceiling(nums[i]);
        if(y!= null && nums[i]<= y+t)
            return true;

    return false;