### Question:
ImportStatements { public boolean add(String importToAdd) { return importStrings.add(importToAdd); } ImportStatements(
      JCExpression packageTree,
      List<JCImport> importTrees,
      EndPosTable endPositions,
      ImportOrganizer importOrganizer); static ImportStatements create(JCCompilationUnit compilationUnit); static ImportStatements create(
      JCCompilationUnit compilationUnit, ImportOrganizer importOrganizer); int getStartPos(); int getEndPos(); boolean add(String importToAdd); boolean addAll(Collection<String> importsToAdd); boolean remove(String importToRemove); boolean removeAll(Collection<String> importsToRemove); boolean importsHaveChanged(); @Override String toString();  }### Answer:
@Test public void addsAllImports() { ImportStatements imports = new ImportStatements( null, new ArrayList<>(), FAKE_END_POS_MAP, new ImportOrganizer() { @Override public OrganizedImports organizeImports(List<Import> imports) { return new OrganizedImports(); } }); imports.add("import java.util.List"); IllegalStateException exception = assertThrows(IllegalStateException.class, imports::toString); assertThat(exception) .hasMessageThat() .isEqualTo("Expected 1 import(s) in the organized imports but it contained 0"); }