How can I sort an arraylist by his first element in java without using any streams and lambda? Example: (1, "dog"), (3, "cat"), (2, "chicken"),