sorting arraylist based on another arraylist

how can i sort 2 arraylist but only using 1 of them as criteria.

Like if I have arraylists and want to sort it based on the integers of x in ascending order.

x: [3,5,1,7,4]

y: [4,6,3,10,11]

I need to sort it so the arraylists become

x: [1,3,4,5,7]

y: [3,4,11,6,10]

so arraylist y is sorted according to x's ascending status, (meaning that all changes of x are transferred to y, so if for example x's 3rd element is moved to first position, y's 3rd element is moved to 1st as well, regardless of y's element's size.