There are 2 lists of objects A and B. So List<A> and List<B>.
A and B have a common Sting field id which connects them.
B also has a numeric field value.
We want to sort list A based on the value present in list B.
What's the best way to do it using Java APIs, perhaps like Comparator?