GetEnvironmentsUtilImpl implements GetEnvironmentsUtil { @NotNull @Override public List<RunnerEnvironmentLeaf> getAllEnvironments(@NotNull RunnerEnvironmentTree tree) { List<RunnerEnvironmentLeaf> allEnvironments = new ArrayList<>(); getEnvironments(tree, allEnvironments); return allEnvironments; } @Inject  GetEnvironmentsUtilImpl(ModelsFactory modelsFactory, ProjectTypeRegistry projectTypeRegistry, AppContext appContext); @NotNull @Override List<RunnerEnvironmentLeaf> getAllEnvironments(@NotNull RunnerEnvironmentTree tree); @NotNull @Override List<Environment> getEnvironmentsFromNodes(@NotNull List<RunnerEnvironmentLeaf> leaves, @NotNull Scope scope); @NotNull @Override List<Environment> getEnvironmentsByProjectType(@NotNull RunnerEnvironmentTree tree,
                                                          @NotNull String projectType,
                                                          @NotNull Scope scope); @Override @NotNull String getType(); @NotNull @Override String getCorrectCategoryName(@NotNull String defaultRunner); @NotNull @Override RunnerEnvironmentTree getRunnerCategoryByProjectType(@NotNull RunnerEnvironmentTree tree, @NotNull String projectType);  }
@Test public void allEnvironmentsShouldBeReturned() { List<RunnerEnvironmentLeaf> result = util.getAllEnvironments(tree); assertThat(result.size(), is(6)); assertThat(result, hasItems(runnerEnvLeaf1, runnerEnvLeaf2, runnerEnvLeaf3, runnerEnvLeaf4, runnerEnvLeaf5, runnerEnvLeaf6)); }