JUnitCore junitCore = new JUnitCore();
Request request = Request.aClass(ExampleTest.class);
Request requestFiltered = request.filterWith(new Exclude("test1"));
Request requestFilteredFiltered = requestFiltered
.filterWith(new Exclude("test2"));
Result result = junitCore.run(requestFilteredFiltered);
assertThat(result.getFailures(), isEmpty());
assertEquals(1, result.getRunCount());
}