public static List<Feature> getMissingFeatures( List<Feature> supportedFeatures, List<Feature> existingFeatures) { HashMap<String, Feature> featureHashMap = new HashMap(); for (Feature feature : existingFeatures) { featureHashMap.put(feature.getCode(), feature); } List<Feature> missingFeatures = new ArrayList<Feature>(); for (Feature supportedFeature : supportedFeatures) { if (featureHashMap.get(supportedFeature.getCode()) != null) { continue; } missingFeatures.add(supportedFeature); } return missingFeatures; }
public static MobileFeature convertToMobileFeature(Feature feature) { MobileFeature mobileFeature = new MobileFeature(); mobileFeature.setName(feature.getName()); mobileFeature.setCode(feature.getCode()); mobileFeature.setDescription(feature.getDescription()); mobileFeature.setDeviceType(feature.getDeviceType()); return mobileFeature; }