Skip to content

Instantly share code, notes, and snippets.

@east825
Created June 22, 2013 22:06
Show Gist options
  • Save east825/5842803 to your computer and use it in GitHub Desktop.
Save east825/5842803 to your computer and use it in GitHub Desktop.
package generics.minfunction;
import java.util.ArrayList;
import java.util.List;
public class Test {
private static class Top {}
private static class Middle extends Top implements Comparable<Top> {
@Override
public int compareTo(Top o) {
return 0;
}
}
private static class Bottom extends Middle {}
public static void main(String[] args) {
List<Bottom> bottoms = new ArrayList<Bottom>();
Middle result = Algorithms.min(bottoms);
Middle result2 = Algorithms.wrongMin(bottoms);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment