PluginCenterController implements Initializable { protected boolean fileSeemsValid(final PluginFile file) throws FileNotFoundException { if (file == null) throw new NullPointerException("The file to check can not be null"); if (!file.exists()) throw new FileNotFoundException("The file to check must exist"); final RegisteredPlugin plugin = new RegisteredPlugin(file); final String name = plugin.getName(); final String version = plugin.getVersion(); return isValueValid(name) && isValueValid(version); }  void validatePluginsConfiguration(); @Override void initialize(URL location, ResourceBundle resources);  }
@Test public void fileSeemsInvalidWhenNullFile() { assertThrows(NullPointerException.class, () -> controller.fileSeemsValid(null)); }
@Test public void fileSeemsInvalidWhenFileNotExists() { assertThrows(FileNotFoundException.class, () -> controller.fileSeemsValid(MISSING_FILE)); }