### Question:
FileSystemManager implements Initializable { public File getDir(String directory) { Objects.requireNonNull(directory); File dir; if (!SYSTEM_TEMP_DIR.equals(directory)) { dir = new File(getBaseDirectory() + directory); if (dir.mkdirs()) { LOG.log(Level.FINEST, "Not all directories were created. Highly likely directories already exist. If not, Check permission and Disk Space"); } } else { dir = new File(directory); } return dir; } protected  FileSystemManager(); static FileSystemManager getInstance(); List<String> getTopLevelDirectories(Set<String> exclude); File getDir(String directory); File getConfig(String configFilename); File getImportLookup(String configFilename); File getImportLookup(String configFilename, NewFileHandler newFileHandler); InputStream getApplicationResourceFile(String resource); long copy(InputStream source, OutputStream sink); @Override void initialize(); @Override void shutdown(); @Override boolean isStarted(); String getBaseDirectory(); void setBaseDirectory(String baseDirectory); static final String MAIN_PERM_DIR; static final String MAIN_TEMP_DIR; static final String SYSTEM_TEMP_DIR; static final String CONFIG_DIR; static final String IMPORT_DIR; static final String IMPORT_HISTORY_DIR; static final String IMPORT_LOOKUP_DIR; static final String IMPORT_ARTICLE_DIR; static final String IMPORT_HIGHLIGHT_DIR; static final String IMPORT_COMPONENT_DIR; static final String ARTICLE_DIR; static final String MEDIA_DIR; static final String ATTACHMENT_DIR; static final String ARCHIVE_DIR; static final String GENERAL_MEDIA_DIR; static final String SUPPORT_MEDIA_DIR; static final String TEMPORARY_MEDIA_DIR; static final String ERROR_TICKET_DIR; static final String RESOURCE_DIR; static final String ORGANIZATION_DIR; static final String REPORT_DIR; static final String PLUGIN_DIR; static final String COMPONENT_VERSION_DIR; static final String PLUGIN_UNINSTALLED_DIR; static final String PLUGIN_FAILED_DIR; static final String DB_DIR; }### Answer:
@Test public void testGetDir() { LOG.info("getDir"); LOG.info("Scenario 1: Create Directory"); String directory = "/unittest"; File expResult = new File(testFileSystemManager.getBaseDirectory() + directory); File result = testFileSystemManager.getDir(directory); assertEquals(expResult, result); if (!result.exists()) { fail("The directory should exist"); } LOG.info("Scenario 2: Null Input"); try { testFileSystemManager.getDir(null); fail("This should throw expection"); } catch (NullPointerException ex) { } }