public boolean isValid() {
        if (PluggableTaskConfigStore.store().preferenceFor(pluginConfiguration.getId()) == null) {
            addError(TYPE, String.format("Could not find plugin for given pluggable id:[%s].", pluginConfiguration.getId()));
        }

        configuration.validateTree();

        return (errors.isEmpty() && !configuration.hasErrors());
    }
@Test
    public void isValidShouldVerifyIfPluginIdIsValid() {
        PluginConfiguration pluginConfiguration = new PluginConfiguration("does_not_exist", "1.1");
        Configuration configuration = new Configuration();
        PluggableTask pluggableTask = new PluggableTask(pluginConfiguration, configuration);

        pluggableTask.isValid();

        assertThat(pluggableTask.errors().get("pluggable_task").get(0), is("Could not find plugin for given pluggable id:[does_not_exist]."));
    }