public static String reverse(String str) {
        if (str == null) {
            return null;
        }
        return new StringBuilder(str).reverse().toString();
    }
<p>Reverses a String as per {@link StringBuilder#reverse()}.</p>

<p>A {@code null} String returns {@code null}.</p>

<pre>
StringUtils.reverse(null)  = null
StringUtils.reverse("")    = ""
StringUtils.reverse("bat") = "tab"
</pre>

@param str  the String to reverse, may be null
@return the reversed String, {@code null} if null String input
android/android_framework/base/src/main/java/lang3/StringUtils.java