/** * Diff maps. * * @param mapOld * @param mapNew * @return list of different properties */ public static List<String> getDiffProperties(Map<String, String> mapOld, Map<String, String> mapNew) { List<String> result = new ArrayList<String>(); if (mapOld == null) { mapOld = new HashMap<String, String>(); } if (mapNew == null) { mapNew = new HashMap<String, String>(); } // Create common list of properties Set<String> properties = new HashSet<String>(); properties.addAll(mapOld.keySet()); properties.addAll(mapNew.keySet()); // Compare for (String beanProperty : properties) { String oldValue = mapOld.get(beanProperty); String newValue = mapNew.get(beanProperty); if (differs(oldValue, newValue)) { result.add(beanProperty); } } return result; }