void (String[] args) { List<Point> l = Arrays.asList(new Point(1, 0), new Point(0, 1), new Point(0, 0))); l.sort((o1, o2) -> o1.x < o2.x ? -1 : o1.x > o2.x ? 1 : Integer.compare(o1.y, o2.y)); System.out.println(l); }