ImmutableText (@NotNull CharSequence str) { if (str instanceof ByteArrayCharSequence) { return new ImmutableText(str); } if (str.length() == 0) { return EMPTY; } return new ImmutableText(str.toString()); }