code: public static boolean canUseOriginalForSubSequence(CharSequence str, int start, int count) {
          if (start != 0) return false;
          final Class<?> csqClass = str.getClass();
          return (csqClass == String.class || csqClass == StringBuilder.class || csqClass == StringBuffer.class) && count == str.length();
      }
docs: Checks if start == 0 and count == length of CharSequence
  It does this check only for String, StringBuilder and StringBuffer classes which have a fast way to check length
  
  Calculating length on GStringImpl requires building the result which is costly.
  This helper method is to avoid calling length on other that String, StringBuilder and StringBuffer classes
  when checking if the input CharSequence instance is already the same as the requested sub sequence
  
  @param str CharSequence input
  @param start start index
  @param count length on sub sequence
  @return true if input is String, StringBuilder or StringBuffer class, start is 0 and count is length of input sequence