void () { try { initializeSuitesAndJarFile(); List<XmlSuite> suites = Lists.newArrayList(); calculateAllSuites(m_suites, suites); if(!suites.isEmpty()) { for (XmlSuite suite : suites) { final List<XmlTest> tests = suite.getTests(); for (XmlTest test : tests) { try { if (myParam != null) { for (XmlClass aClass : test.getXmlClasses()) { List<XmlInclude> includes = new ArrayList<>(); for (XmlInclude include : aClass.getIncludedMethods()) { includes.add(new XmlInclude(include.getName(), Collections.singletonList(Integer.parseInt(myParam)), 0)); } aClass.setIncludedMethods(includes); } } } catch (NumberFormatException e) { System.err.println("Invocation number: expected integer but found: " + myParam); } } } attachListeners(new IDEATestNGRemoteListener()); super.run(); } else { System.out.println("##teamcity[enteredTheMatrix]"); System.err.println("Nothing found to run"); } System.exit(0); } catch(Throwable cause) { cause.printStackTrace(System.err); System.exit(-1); } }