### Question:
Configuration { public List<ConfigurationTemplatesDir> getTemplatesDirs() { return templatesDirs; }  static Configuration getDefault(); static String[] getSupportedLanguages(); static String getApplicationHome(); void resetModifiedFlag(); @Transient boolean isTemplatesDirModified(); int getPort(); void setPort(int port); boolean isShowTestData(); void setShowTestData(boolean showTestData); boolean isWebDevelopmentMode(); void setWebDevelopmentMode(boolean webDevelopmentMode); List<ConfigurationTemplatesDir> getTemplatesDirs(); void setTemplatesDirs(List<ConfigurationTemplatesDir> templatesDirs); void addTemplatesDir(String templateDir); void addTemplatesDir(String templateDir, boolean recursive); void copyFrom(Configuration other);  }### Answer:
@Test void configurationLoadTest() throws Exception { Preferences preferences = mock(Preferences.class); ConfigurationHandler configurationHandler = new ConfigurationHandler(preferences); Configuration configuration = configurationHandler.getConfiguration(); when(preferences.get(ConfigurationHandler.TEMPLATES_DIRS, null)).thenReturn(null) .thenReturn("[{\"directory\":\"" + DIR1 + "\",\"recursive\":false}]") .thenReturn("[{\"directory\":\"" + DIR1 + "\",\"recursive\":false},{\"directory\":\"" + DIR2 + "\",\"recursive\":false},{\"directory\":\"" + DIR3b + "\",\"recursive\":false}]"); configurationHandler.load(); assertNull(configuration.getTemplatesDirs()); configurationHandler.load(); assertEquals(1, configuration.getTemplatesDirs().size()); assertEquals(DIR1, configuration.getTemplatesDirs().get(0).getDirectory()); configurationHandler.load(); assertEquals(3, configuration.getTemplatesDirs().size()); assertEquals(DIR1, configuration.getTemplatesDirs().get(0).getDirectory()); assertEquals(DIR2, configuration.getTemplatesDirs().get(1).getDirectory()); assertEquals(DIR3, configuration.getTemplatesDirs().get(2).getDirectory()); }