Heterogenous Tuple of Infinite Size
One example use case of
Foo<?>is an implementation of aTupleof infinite size storing different object typespublic class Favorites { private Map<Class<?>, Object> favorites = new HashMap<>(); public <T> void putFavorite(Class<T> type, T instance) { Assert.assertNotNull(instance); favorites.put(type, instance); } public <T> T getFavorite(Class<T> type) { return type.cast(favorites.get(type)); } }