I have the method:
<T extends Comparable<T>> T moreApproxEqual(T object, T less, T greater) {
//TODO: return less or greater, depending on which is closer to object
return null;
}
I have a list of T and from that I found the variables "less" and "greater" to be the closest two values in the list to the variable "object". Is there any way I can tell if one of the two objects is closer to "object" without any more information on the objects?