import java.util.Collection; import java.util.List; interface Mappable { T map(Mapper mapper); class Foo, U extends Foo> implements Mappable> { static class FooBuilder, U extends Foo> {} @Override public Foo map(Mapper mapper) { return this; } } class Mapper { > List map(List in) { return in; } > Collection map(Collection in) { return in; } } class Counter implements Mappable { private final List> in; Counter(List> in) { this.in = in; } @Override public Counter map(Mapper mapper) { return new Counter(mapper.map(in)); } } }