ScalaSnippetExecutor extends AbstractSnippetExecutor<ScalaSnippetExecutorOptions> { protected String formatImportLine(final String importLine) { final String importLineBeginning = "import "; String formattedImportLine; if (importLine.startsWith(importLineBeginning)) { formattedImportLine = importLine; } else { formattedImportLine = importLineBeginning.concat(importLine); } return formattedImportLine; } ScalaSnippetExecutor(); @Override Parent getUI(final CodeSnippet codeSnippet); @Override Node getConfigurationUI(); @Override void saveNewOptions(); @Override ObservableList<String> execute(final CodeSnippet codeSnippet);  }
@Test public void formatImportWithoutImportKeyword() { assertEquals("import mypackage", snippetExecutor.formatImportLine("mypackage")); }
@Test public void formatImportWithImportKeyword() { assertEquals("import mypackage", snippetExecutor.formatImportLine("import mypackage")); }