🐷

Comparatorの比較でnullを後にする

2021/02/28に公開
if (o1 == null || o2 == null) {
    return (o1 == null ? 1 : 0) - (o2 == null ? 1 : 0);
}

Discussion