duplicated comparator to build java 5 comparison class