### Question:
Setting { public Set<HashMap<String, String>> getSettingValue(String settingName) { if (properties.containsKey(settingName)) { return properties.get(settingName); } return Collections.emptySet(); } Setting(Map<String, Set<HashMap<String, String>>> properties); Map<String, Set<HashMap<String, String>>> getProperties(); Set<HashMap<String, String>> getSettingValue(String settingName); static final String SETTING_NAME_RECOVERY_SETTINGS; static final String SETTING_NAME_SERVICE_SETTINGS; static final String SETTING_NAME_COMPONENT_SETTINGS; static final String SETTING_NAME_DEPLOYMENT_SETTINGS; static final String SETTING_NAME_RECOVERY_ENABLED; static final String SETTING_NAME_SKIP_FAILURE; static final String SETTING_NAME_NAME; static final String SETTING_NAME_REPOSITORY_SETTINGS; static final String SETTING_NAME_CREDENTIAL_STORE_ENABLED; }### Answer:
@Test public void testGetSettingProperties() { Map<String, Set<HashMap<String, String>>> properties = new HashMap<>(); Set<HashMap<String, String>> setting1 = new HashSet<>(); Set<HashMap<String, String>> setting2 = new HashSet<>(); HashMap<String, String> setting1Properties1 = new HashMap<>(); setting1Properties1.put(Setting.SETTING_NAME_RECOVERY_ENABLED, "true"); setting1.add(setting1Properties1); HashMap<String, String> setting2Properties1 = new HashMap<>(); setting2Properties1.put(Setting.SETTING_NAME_NAME, "HDFS"); setting2Properties1.put(Setting.SETTING_NAME_RECOVERY_ENABLED, "false"); HashMap<String, String> setting2Properties2 = new HashMap<>(); setting2Properties2.put(Setting.SETTING_NAME_NAME, "TEZ"); setting2Properties2.put(Setting.SETTING_NAME_RECOVERY_ENABLED, "false"); setting2.add(setting2Properties1); setting2.add(setting2Properties2); properties.put(Setting.SETTING_NAME_RECOVERY_SETTINGS, setting1); properties.put(Setting.SETTING_NAME_SERVICE_SETTINGS, setting2); Setting setting = new Setting(properties); assertEquals(setting2, setting.getSettingValue(Setting.SETTING_NAME_SERVICE_SETTINGS)); }