Given two strings, str1 and str2, the code below shows a single line of code that returns whether or not str2 is a rotation of str1.
return (str1 + str1).matches("(?i).*" + Pattern.quote(str2) + ".*");