public final TestSuite build(){
  rootSuite=new TestSuite(getSuiteName());
  currentClassname=null;
  try {
    for (    TestMethod test : testGrouping.getTests()) {
      if (satisfiesAllPredicates(test)) {
        addTest(test);
      }
    }
    if (testCases.size() > 0) {
      for (      TestCase testCase : testCases) {
        if (satisfiesAllPredicates(new TestMethod(testCase))) {
          addTest(testCase);
        }
      }
    }
  }
 catch (  Exception exception) {
    Log.i("TestSuiteBuilder","Failed to create test.",exception);
    TestSuite suite=new TestSuite(getSuiteName());
    suite.addTest(new FailedToCreateTests(exception));
    return suite;
  }
  return rootSuite;
}

public final TestSuite build ( ) { rootSuite = new TestSuite ( getSuiteName ( ) ) ; currentClassname = null ; try { for ( TestMethod test : testGrouping . getTests ( ) ) { if ( satisfiesAllPredicates ( test ) ) { addTest ( test ) ; } } if ( testCases . size ( ) > 0 ) { for ( TestCase testCase : testCases ) { if ( satisfiesAllPredicates ( new TestMethod ( testCase ) ) ) { addTest ( testCase ) ; } } } } catch ( Exception exception ) { Log . i ( "TestSuiteBuilder" , "Failed to create test." , exception ) ; TestSuite suite = new TestSuite ( getSuiteName ( ) ) ; suite . addTest ( new FailedToCreateTests ( exception ) ) ; return suite ; } return rootSuite ; }
call this method once you ' ve configured your builder as desired .
