import java.util.ArrayList; import java.util.Collection; import lombok.Delegate; public class DelegateExample { long counter = 0L; @Delegate private final Collection collection = new ArrayList(); public boolean add(String name) { counter++; return collection.add(name); } } class PartialDelegationExample { @Delegate({SimpleCollection.class}) private final Collection collection = new ArrayList(); private interface SimpleCollection { boolean add(String item); boolean remove(Object item); } }