Possible alternative from the source code of Integer.compare
method which requires API Version 19
is :
public int compareTo(Animal other) {
return Integer.valueOf(this.year_discovered).compareTo(other.year_discovered);
}
This alternative does not require you to use API version 19
.