Although Java doesn't support this, you can use a generics trick to simulate it.
class Test {
void x(I i, L l) {
System.out.println(
i.intValue() + ", " +
l.longValue()
);
}
}
Source: http://blog.jooq.org/2014/11/03/10-things-you-didnt-know-about-java/