import java.util.List; import java.util.Map; import lombok.experimental.ExtensionMethod; @ExtensionMethod(ExtensionMethodGeneric.Extensions.class) class ExtensionMethodGeneric { static class Extensions { Extensions() { super(); } public static List test(List obj, List list) { return null; } public static K test(Map obj, K k, V v) { return k; } public static T test(List list) { return null; } public static U test2(List list) { return null; } } ExtensionMethodGeneric() { super(); } public void test() { List stringList = null; List numberList = null; ExtensionMethodGeneric.Extensions.test(stringList); ExtensionMethodGeneric.Extensions.test(stringList, numberList); ExtensionMethodGeneric.Extensions.test(ExtensionMethodGeneric.Extensions.test(stringList, stringList), numberList); Integer i = ExtensionMethodGeneric.Extensions.test2(stringList); Map map = null; List l = ExtensionMethodGeneric.Extensions.test(map, stringList, numberList); } }