我有两张地图:
Map<String, Sample> newMap = convertJSONObjectToSampleMap(newMapStr);
Map<String, Sample> oldMap = convertJSONObjectToSampleMap(oldMapStr);
这Sample是一些自定义类
有 newMap键:[1,2,3,4,5]
有 oldMap键:[2,3,4,5,8]
获得它们之间差异的最佳方法是什么,.e, get Samples with keys: 1and 8?
我想使用Collections和提取Set<>:
Set<String> newSet = newMap.keySet();
Set<String> oldSet = oldMap.keySet();
谢谢,
