@Test
    public void testComparatorInt(){
        List<Obj> list = new ArrayList<Obj>();
        list.add(new Obj("a", 10));
        list.add(new Obj("b", 2));
        list.add(new Obj("c", 6));
        list.add(new Obj("d", 6));
        list.add(new Obj("e", 0));
        list.add(new Obj("f", -1));
        list.add(new Obj("g", 10));

        list.sort(Comparator.comparingInt(Obj::getOrder));
        StringBuilder sb = new StringBuilder();
        for (Obj test : list) {
            sb.append(test.getName());
        }
        Assert.assertEquals(sb.toString(), "febcdag");


        list.sort(Comparator.comparingInt(Obj::getOrder).reversed());
        sb = new StringBuilder();
        for (Obj test : list) {
            sb.append(test.getName());
        }
        Assert.assertEquals(sb.toString(), "agcdbef");
    }
@author <a href="mailto:zhanggeng.zg@antfin.com">GengZhang</a>
core/common/src/test/java/com/alipay/sofa/rpc/common/struct/OrderedComparatorTest.java