This does the same thing as a previous post about Swift doing a sort on two dimensions.
https://github.com/mevdev/Two_Dimensional_Sorting_Java
I made this one java file within inline classes to simplify the running of it. It’s really too bad there isn’t something like Playgrounds for Java and Android.