Add java comparator example