code: public static char[] toChars(int codePoint) {
          if (isBmpCodePoint(codePoint)) {
              return new char[] { (char) codePoint };
          } else if (isValidCodePoint(codePoint)) {
              char[] result = new char[2];
              toSurrogates(codePoint, result, 0);
              return result;
          } else {
              throw new IllegalArgumentException();
          }
      }
docs: Converts the specified character (Unicode code point) to its
  UTF-16 representation stored in a {@code char} array. If
  the specified code point is a BMP (Basic Multilingual Plane or
  Plane 0) value, the resulting {@code char} array has
  the same value as {@code codePoint}. If the specified code
  point is a supplementary code point, the resulting
  {@code char} array has the corresponding surrogate pair.
  
  @param  codePoint a Unicode code point
  @return a {@code char} array having
  {@code codePoint}'s UTF-16 representation.
  @exception IllegalArgumentException if the specified
  {@code codePoint} is not a valid Unicode code point.
  @since  1.5