Check out example codes for "lambda comparator java". It will help you in understanding the concepts better.

Code Example 1

Comparator<Developer> byName =
	(Developer o1, Developer o2)->o1.getName().compareTo(o2.getName());

Learn ReactJs, React Native from akashmittal.com