新数据:
ArrayList<Comment> newComments = getComments();
已经存在的数据,已经填写了一些数据:
ArrayList<Comment> oldComments
我不能用新内容覆盖整个旧内容。
我希望将新的(尚未存在的)Comment对象newComments添加到 中oldComments,也希望将缺少的那些newComments从 中删除oldComments。
Collections包装中有一些好的方法吗?或任何其他方式?
注意:Comment类有自定义compare()方法(不使用 default equals())