Created
June 22, 2013 22:06
-
-
Save east825/5842803 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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