@Test public void shouldReturnFalseIfS2IsNotRotationOfS1() { String s1 = "waterbottle"; String s2 = "pedro"; boolean result = isRotation.check(s1, s2); assertFalse(result); }
public boolean check(String s1, String s2) { validateInput(s1, s2); if (haveSameLength(s1, s2)) { String s1s1 = s1 + s1; return isSubstring(s1s1, s2); } return false; }
IsRotationUsingIsSubstring { public boolean check(String s1, String s2) { validateInput(s1, s2); if (haveSameLength(s1, s2)) { String s1s1 = s1 + s1; return isSubstring(s1s1, s2); } return false; } }
IsRotationUsingIsSubstring { public boolean check(String s1, String s2) { validateInput(s1, s2); if (haveSameLength(s1, s2)) { String s1s1 = s1 + s1; return isSubstring(s1s1, s2); } return false; }  }
IsRotationUsingIsSubstring { public boolean check(String s1, String s2) { validateInput(s1, s2); if (haveSameLength(s1, s2)) { String s1s1 = s1 + s1; return isSubstring(s1s1, s2); } return false; }  boolean check(String s1, String s2); }
IsRotationUsingIsSubstring { public boolean check(String s1, String s2) { validateInput(s1, s2); if (haveSameLength(s1, s2)) { String s1s1 = s1 + s1; return isSubstring(s1s1, s2); } return false; }  boolean check(String s1, String s2);  }