Comparator<Sdk> () { return (sdk1, sdk2) -> { assert sdk1.getSdkType() == this : sdk1; assert sdk2.getSdkType() == this : sdk2; return Comparing.compare(getJavaVersion(sdk1), getJavaVersion(sdk2)); }; }