### Question:
FileSystemManager implements Initializable { public long copy(InputStream source, OutputStream sink) throws IOException { Objects.requireNonNull(source); Objects.requireNonNull(sink); long nread = 0L; byte[] buf = new byte[BUFFER_SIZE]; int n; while ((n = source.read(buf)) > 0) { sink.write(buf, 0, n); nread += n; } return nread; } 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 testCopy() throws IOException { LOG.info("testCopy: "); LOG.info("Scenario 1: Copy everything filled out"); String fileName = "readme.txt"; byte[] b = fileName.getBytes(); ByteArrayInputStream bin = new ByteArrayInputStream(b); ByteArrayOutputStream bout = new ByteArrayOutputStream(b.length); long result = testFileSystemManager.copy(bin, bout); assertEquals(b.length, result); LOG.info("Scenario 2: Null Output"); try { bin = new ByteArrayInputStream(b); result = testFileSystemManager.copy(bin, null); fail("Outputstream object cannot be null"); } catch (NullPointerException e) { } LOG.info("Scenario 3: Null Input"); try { result = testFileSystemManager.copy(null, bout); fail("Inputstream object cannot be null"); } catch (NullPointerException e) { } }