public static String next(CharSequence self){
  StringBuilder buffer=new StringBuilder(self);
  if (buffer.length() == 0) {
    buffer.append(Character.MIN_VALUE);
  }
 else {
    char last=buffer.charAt(buffer.length() - 1);
    if (last == Character.MAX_VALUE) {
      buffer.append(Character.MIN_VALUE);
    }
 else {
      char next=last;
      next++;
      buffer.setCharAt(buffer.length() - 1,next);
    }
  }
  return buffer.toString();
}

public static String next ( CharSequence self ) { StringBuilder buffer = new StringBuilder ( self ) ; if ( buffer . length ( ) == 0 ) { buffer . append ( Character . MIN_VALUE ) ; } else { char last = buffer . charAt ( buffer . length ( ) - 1 ) ; if ( last == Character . MAX_VALUE ) { buffer . append ( Character . MIN_VALUE ) ; } else { char next = last ; next ++ ; buffer . setCharAt ( buffer . length ( ) - 1 , next ) ; } } return buffer . toString ( ) ; }
this method is called by the + + operator for the class charsequence . it increments the last character in the given charsequence . if the last character in the charsequence is character . max_value a character . min_value will be appended . the empty charsequence is incremented to a string consisting of the character character . min_value .
