Collections.sort(groky, new Comparator<Grok>() {
public int compare(Grok g1, Grok g2) {
return (this.complexity(g1.getNamedRegex()) < this.complexity(g2.getNamedRegex())) ? 1 : 0;
}
groky.sort(
new Comparator<Grok>() {
public int compare(Grok g1, Grok g2) {
return Integer.compare(
this.complexity(g2.getNamedRegex()), this.complexity(g1.getNamedRegex()));
}