Unfortunately not. Since Java implements generics with erasure, these two methods will be compiled to:
doSomething(List)
Since you cannot use two methods with the same signature, this will not compile.
The best you can do is:
doSomethingData(List<Data>) doSomethingDouble(List<Double>)
or something just as unpleasant.
source share