Collections.sort(list,(x,y)->{
if(x.getAge()!=y.getAge())
return Integer.compare(x.getAge(),y.getAge());
else
return x.getName().compareTo(y.getName());
});
Collections.sort(list,(x,y)->{
if(x.getAge()!=y.getAge())
return Integer.compare(x.getAge(),y.getAge());
else
return x.getName().compareTo(y.getName());
});