// Can a be converted to b? // score 0 = exact match // score Int.MAX_VALUE = no match // score 1 = conversion needed (boxing/unboxing or non-primitve widening) // score -1 = primitive widening needed static int typeConversionScoreWithUnboxing(Class a, Class b) { int score = typeConversionScore(a, b); Class aPrim = boxedToPrimitive(a); if (aPrim != null) score = min(score, typeConversionScore(aPrim, b)); ret score; }