If you want to use org.apache.commons.collections.CollectionUtils then you should use subtract method.
Collection<Officer> insertList= CollectionUtils.subtract(list1, list2);
Collection<Officer> deleteList = CollectionUtils.subtract(list2, list1);
or you could write it like this (passing empty lists that are filled in method) not to add another library to your dependencies:
static <T> void process(List<T> list1, List<T> list2, List<T> insertList, List<T> deleteList) {
for (T t: list1) {
if (!list2.contains(t)) {
insertList.add(t);
}
}
for (T t: list2) {
if (!list1.contains(t)) {
deleteList.add(t);
}
}
}
Don't forget to override equals and hashcode methods for you class Officer in both cases. Please refer here for explanation