import java.util.*; class IdeaGenericsTest { interface Animal> { List getFriends(); } class Dog implements Animal { public List getFriends() { return null; } } class Cat implements Animal { public List getFriends() { return null; } } void mixAnimals() { ArrayList dogs = null; ArrayList cats = null; makeFriends(cats, dogs); } private, V extends ArrayList> void makeFriends(ArrayList someAnimals, V otherAnimals) { someAnimals.add(otherAnimals.get(0)); } }