What are the possibilities to design an API that needs overloads depending on a generic type?
In a given class Example<A> I need the following two functions to be available: void doSomething(Supplier<A>) <B> void doSomething(Supplier<B>) What are the possibilities to achieve this? I know the following approaches: give the functions different names use a wrapper-type for the second-definition WrapperType.of(Supplier<B>) use a function that converts Example<A> to Example<B> Are there any other approaches? I dislike 1) as it clutters my API. 2) is really verbose as I have to call said function often and static imports are very unusual outside of testing code. 3) is very explicit about the