In this tutorial, it shows the use of java.lang.Comparable and java.util.Comparator to sort a Java object based on its property value.