to judge if two strings are circularly Shifted or not in java.