code: public static boolean belongsToAlphabet(Alphabet<?> alphabet, String string) {
          for (int i = 0; i < string.length(); ++i)
              if (alphabet.symbolToCode(string.charAt(i)) == -1)
                  return false;
          return true;
      }
docs: Check if a sequence contains letters only from specified alphabet. So in can be converted to corresponding type
  of sequence.
  
  @param alphabet alphabet
  @param string   string to check
  @return {@literal true} if sequence belongs to alphabet, {@literal false} if does not