code: protected void ensureValidFlags(final String actual, 
                                      final char[] expected) {
          if (actual == null) return;
          StringBuilder unexpected = null;
          for (int i = 0; i < actual.length(); i++) {
              char c = actual.charAt(i);
              if (Arrays.binarySearch(expected, c) < 0) {
                  if (unexpected == null) unexpected = new StringBuilder();
                  unexpected.append(c);
              }
          }
          if (unexpected != null) {
              throw FormatException.formatFlagsMismatch(
                      unexpected.toString(), getFormatName());
          }
      }
docs: Ensures that {@code actual} only contains {@code expected} flags.
  @param actual
  @param expected a {@link #flags(java.lang.String) flags} array
  @throws FormatException if invalid flags are found