class GenericMethodArguments { static class Items { public Output apply(Transform, Output> t) { return null; } } static class Transforms { public static Transform of(DoFn fn) { return null; } } static class Transform {} static class DoFn {} static class MyFn1 extends DoFn {} static class MyFn2 extends MyFn1 {} private Items items; public void useCase1() { items.apply(Transforms.of(new MyFn2())); } public void useCase2() { items.apply(Transforms.of(new DoFn(){})); } }