protected boolean isValidScheme(String scheme) {
        if (scheme == null) {
            return false;
        }

        if (!SCHEME_PATTERN.matcher(scheme).matches()) {
            return false;
        }

        if (isOff(ALLOW_ALL_SCHEMES) && !allowedSchemes.contains(scheme.toLowerCase(Locale.ENGLISH))) {
            return false;
        }

        return true;
    }
@Test
   public void testIsValidScheme() {
      if (printStatus) {
         System.out.print("\n testIsValidScheme() ");
      }
      //UrlValidator urlVal = new UrlValidator(schemes,false,false,false);
      UrlValidator urlVal = new UrlValidator(schemes, 0);
       for (ResultPair testPair : testScheme) {
           boolean result = urlVal.isValidScheme(testPair.item);
           assertEquals(testPair.item, testPair.valid, result);
           if (printStatus) {
               if (result == testPair.valid) {
                   System.out.print('.');
               } else {
                   System.out.print('X');
               }
           }
       }
      if (printStatus) {
         System.out.println();
      }

   }