@Test public void basicTest() { Assert.assertTrue(CyclicRotationString.isCyclicRotation("abc", "bca")); Assert.assertTrue(CyclicRotationString.isCyclicRotation("abc", "cab")); Assert.assertTrue(CyclicRotationString.isCyclicRotation("abcd", "cdab")); Assert.assertFalse(CyclicRotationString.isCyclicRotation("abc", "bac")); Assert.assertFalse(CyclicRotationString.isCyclicRotation("abc", "ab")); }
public static boolean isCyclicRotation(String a, String b) { if (a.length() != b.length()) return false; KMPplus kmp = new KMPplus(b); return kmp.search(a + a) != -1; }
CyclicRotationString { public static boolean isCyclicRotation(String a, String b) { if (a.length() != b.length()) return false; KMPplus kmp = new KMPplus(b); return kmp.search(a + a) != -1; } }
CyclicRotationString { public static boolean isCyclicRotation(String a, String b) { if (a.length() != b.length()) return false; KMPplus kmp = new KMPplus(b); return kmp.search(a + a) != -1; }  }
CyclicRotationString { public static boolean isCyclicRotation(String a, String b) { if (a.length() != b.length()) return false; KMPplus kmp = new KMPplus(b); return kmp.search(a + a) != -1; }  static boolean isCyclicRotation(String a, String b); }
CyclicRotationString { public static boolean isCyclicRotation(String a, String b) { if (a.length() != b.length()) return false; KMPplus kmp = new KMPplus(b); return kmp.search(a + a) != -1; }  static boolean isCyclicRotation(String a, String b);  }