### Question:
InMemoryInternetFileStore extends InMemoryFileStore implements InternetFileStore { @Override public URL publicUrlForFilePath(final FilePath filePath) throws NonExistentItemException { try { final FileItem fileItem = read(filePath); return new URL("http: } catch (final MalformedURLException e) { throw new IllegalStateException("Invalid file path. directory:[" + filePath.directory() + "], filename:[" + filePath.filename() + "]"); } }  @Override URL publicUrlForFilePath(final FilePath filePath); @Override void write(final FilePath filePath, final FileItem fileItem, final String filename);  }### Answer:
@Test public void shouldNotGeneratePublicUrl_withIncorrectFilePath() throws Exception { final FilePath filePath = randomFilePath(); final InMemoryInternetFileStore fileStore = new InMemoryInternetFileStore(); NonExistentItemException actualException = null; try { fileStore.publicUrlForFilePath(filePath); } catch (final NonExistentItemException e) { actualException = e; } assertNotNull(actualException); }