### Question:
FileStore { public Directory getDirectory() throws FileStoreException { try { synchronized (m_incomingDirectory) { if (m_incomingDirectory.getFile().exists()) { m_incomingDirectory.copyTo(m_currentDirectory, m_incremental); } m_incremental = true; } return m_currentDirectory; } catch (IOException e) { UncheckedInterruptedException.ioException(e); throw new FileStoreException("Could not create file store directory", e); } } FileStore(File directory, Logger logger); Directory getDirectory(); CacheHighWaterMark getCacheHighWaterMark(); void registerMessageHandlers(
    MessageDispatchRegistry messageDispatcher);  }### Answer:
@Test public void testConstruction() throws Exception { File.createTempFile("file", "", getDirectory()); assertEquals(1, getDirectory().list().length); final FileStore fileStore = new FileStore(getDirectory(), null); final File currentDirectory = fileStore.getDirectory().getFile(); assertNotNull(currentDirectory); assertTrue( currentDirectory.getPath().startsWith(getDirectory().getPath())); assertEquals(1, getDirectory().list().length); assertTrue(!currentDirectory.exists()); final File file1 = File.createTempFile("file", "", getDirectory()); try { new FileStore(file1, null); fail("Expected FileStoreException"); } catch (FileStore.FileStoreException e) { } assertTrue(file1.delete()); assertTrue(file1.mkdir()); assertTrue(new File(file1, "current").createNewFile()); try { new FileStore(file1, null); fail("Expected FileStoreException"); } catch (FileStore.FileStoreException e) { } final File readOnlyDirectory = new File(getDirectory(), "directory"); assertTrue(readOnlyDirectory.mkdir()); readOnlyDirectory.setWritable(false); try { new FileStore(readOnlyDirectory, null); if (!System.getProperty("os.name").startsWith("Win")) { fail("Expected FileStoreException"); } } catch (FileStore.FileStoreException e) { } final File notThere = new File(getDirectory(), "notThere"); new FileStore(notThere, null); }