https://medium.com/javarevisited/optimizing-java-applications-with-quick-sort-techniques-and-tips-8f160376e510