Skip to content

Instantly share code, notes, and snippets.

@polyglotpiglet
Created February 11, 2019 12:05
Show Gist options
  • Select an option

  • Save polyglotpiglet/8487d4a3faba40321dd52ca3f844dbce to your computer and use it in GitHub Desktop.

Select an option

Save polyglotpiglet/8487d4a3faba40321dd52ca3f844dbce to your computer and use it in GitHub Desktop.
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
public class Main {
public interface Cat {
}
private static class Tortie implements Cat {
}
public static void main(String... args) {
DoStuff<Cat> catDoStuff = new DoStuff<>();
List<Tortie> torties = Arrays.asList(new Tortie());
catDoStuff.go(torties); // sad
}
public static class DoStuff<T extends Cat> {
void go(Collection<T> items) {
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment