void (final int countOne, final int countTwo, final int countTemp, final int expectedCount, final int expectedTempCount) { final List<RunnerAndConfigurationSettings> configurations = new ArrayList<>(); final RunManager instance = RunManager.getInstance(getProject()); for (int i = 1; i <= countOne; i ++) { final RunnerAndConfigurationSettings first = createFirst(instance, i, false, false, false, false); configurations.add(first); } for (int i = countOne + 1; i <= countOne + countTwo; i ++) { final RunnerAndConfigurationSettings second = createSecond(instance, i, false, false, false, false); configurations.add(second); } for (int i = countOne + countTwo + 1; i <= countOne + countTwo + countTemp; i ++) { final RunnerAndConfigurationSettings temp = createFirst(instance, i, false, false, false, false); temp.setTemporary(true); configurations.add(temp); } final Set<TestUsageDescriptor> expected = new HashSet<>(); if (countOne > 0) { expected.add(new TestUsageDescriptor( "configured.in.project", countOne, create("FirstTestRunConfigurationType", false, false, false, false)) ); } if (countTwo > 0) { expected.add(new TestUsageDescriptor( "configured.in.project", countTwo, create("SecondTestRunConfigurationType", false, false, false, false)) ); } if (countTemp > 0) { expected.add(new TestUsageDescriptor( "configured.in.project", expectedTempCount, create("FirstTestRunConfigurationType", false, false, false, false, true)) ); } expected.add(createTotalCountUsageDescriptor(expectedCount, expectedTempCount)); doTest(configurations, expected, false); }