你可以这样使用EnumSet<MyEnumClass>:Set<MyEnumClass> all = EnumSet.allOf(MyEnumClass.class);EnumSet<MyEnumClass>然后从您的属性创建另一个:Set<MyEnumClass> loaded = EnumSet.noneOf(MyEnumClass.class);for(String property : properties) { loaded.add(MyEnumClass.valueOf(property));}Collection.removeAll然后,您可以使用, Collection.addAll,来检查不同的内容Collection.retainAll:// all will now contain every element from loadedall.addAll(loaded);// all will now contain every element which was not contained in loadedall.removeAll(loaded);// all will now contain every element which was contained in loadedall.retainAll(loaded);