### Question:
MoodHandler implements ApplicationHandler { private Map<String, Object> getSettings(Map<String, Object> settings) { final Map<String, Object> theSettings = new HashMap<String, Object>(); final Object languages = settings.get(MoodHandler.LANGUAGES); theSettings.put(MoodHandler.LANGUAGES, (languages instanceof List) ? (List<String>) languages : Collections.singletonList(languages.toString())); return theSettings; }  SubscriptionData create(VObjectData object, Map<String, Object> settings); void update(SubscriptionData subscription, Map<String, Object> settings); void checkSettings(VObjectData object, Map<String, Object> settings); void delete(SubscriptionData subscription); Map<String, Object> getUISettings(SubscriptionData subscription, APICaller inApiCaller); static SubscriptionData createOrUpdateSubscription(SubscriptionData inSubscription, VObjectData inObject, String[] langsList, FrequencyHandler.Frequency inFrequency); String getSubscriptionInformation(SubscriptionData subscription); static final String LANGUAGES; }### Answer:
@Test public void validSubscriptionWithSingletonsTest() throws InvalidSettingException, MissingSettingException { final VObjectData object = VObjectData.getData(getKowalskyObject()); final Map<String, Object> params = new HashMap<String, Object>(); params.put(MoodHandler.LANGUAGES, "fr"); final SubscriptionData theSubscription = ApplicationHandlerManager.createSubscription(getApplication(), object, params); Assert.assertTrue(theSubscription.isValid()); final Map<String, Object> settings = theSubscription.getSettings(); Assert.assertEquals(1, settings.size()); Assert.assertTrue(settings.containsKey(MoodHandler.LANGUAGES)); Assert.assertEquals(Collections.singletonList("fr"), settings.get(MoodHandler.LANGUAGES)); }
@Test public void validSubscriptionWithListsTest() throws InvalidSettingException, MissingSettingException { final VObjectData object = VObjectData.getData(getKowalskyObject()); final Map<String, Object> params = new HashMap<String, Object>(); final List<String> langs = Arrays.asList("fr", "en"); params.put(MoodHandler.LANGUAGES, langs); final SubscriptionData theSubscription = ApplicationHandlerManager.createSubscription(getApplication(), object, params); Assert.assertTrue(theSubscription.isValid()); final Map<String, Object> settings = theSubscription.getSettings(); Assert.assertEquals(1, settings.size()); Assert.assertTrue(settings.containsKey(MoodHandler.LANGUAGES)); Assert.assertEquals(langs, settings.get(MoodHandler.LANGUAGES)); }