### Question:
WordIndex { public void loadFile(String fileName) throws FileNotFoundException { Scanner fileScanner = new Scanner(new File(fileName)); int wordCounter = 0; while (fileScanner.hasNext()) { wordCounter++; storage.put(fileScanner.next().replaceAll("\\p{Punct}", ""), wordCounter); } }  void loadFile(String fileName); Set<Integer> getIndicesForWord(String word);  }### Answer:
@Test(expected = FileNotFoundException.class) public void ifFileNotFoundThenThrowException() throws FileNotFoundException { WordIndex testIndex = new WordIndex(); testIndex.loadFile("incorrect way"); }