Updated Java Solution
Here is an updated Java solution that takes in the array of integers rather than the list of integers based on StefanPochmann's Binary Search implementation:\n\
Here is an updated Java solution that takes in the array of integers rather than the list of integers based on StefanPochmann's Binary Search implementation:\n\n```\n    public List<Integer> findClosestElements(int[] arr, int k, int x) {\n        int start = 0, end = arr.length-k;\n        \n        while(start<end) {\n            int mid = (start + end)/2;\n            if (x - arr[mid] > arr[mid+k]-x)\n                start = mid + 1;\n            else\n                end = mid;\n        }\n\n        List<Integer> results = new ArrayList<Integer>();\n        for(int i=start;i<start+k;i++){\n            results.add(arr[i]);\n        }\n        return results;\n        \n    }\n```
[]