java判断区间是否重复交叉
private void validRepeatInterval(List<xxDTO> list) {
list.stream().sorted(Comparator.comparing(xxDTO::getStartCode).thenComparing(xxDTO::getEndCode))
.reduce((a, b) -> {
//StartCode,EndCode非空 a.getEndCode()>= b.getStartCode()
if ( a.getEndCode() >= b.getStartCode()) {
//区间重复或交叉 todo
}
return b;
});
}