}
/**
- * Compares two chars either case sensitively or case insensitively depending
- * on the caseSensitive flag
+ * Compares two residues either case sensitively or case insensitively
+ * depending on the caseSensitive flag
*
* @param c1
* first char
* if true comparison will be case sensitive otherwise its not
* @return
*/
- public static boolean compareChars(char c1, char c2, boolean caseSensitive)
+ public static boolean isSameResidue(char c1, char c2,
+ boolean caseSensitive)
{
- boolean sameCase = (Character.isUpperCase(c1) && Character
- .isUpperCase(c2))
- || (Character.isLowerCase(c1) && Character.isLowerCase(c2));
- if (sameCase)
+ if (caseSensitive)
{
- return c1 == c2;
- }
- else if (caseSensitive)
- {
- return false;
+ return (c1 == c2);
}
else
{
}
@Test(groups = { "Functional" })
- public void compareCharsTest()
+ public void testIsSameResidue()
{
- assertTrue(Comparison.compareChars('a', 'a', false));
- assertTrue(Comparison.compareChars('a', 'a', true));
- assertTrue(Comparison.compareChars('A', 'a', false));
- assertTrue(Comparison.compareChars('a', 'A', false));
+ assertTrue(Comparison.isSameResidue('a', 'a', false));
+ assertTrue(Comparison.isSameResidue('a', 'a', true));
+ assertTrue(Comparison.isSameResidue('A', 'a', false));
+ assertTrue(Comparison.isSameResidue('a', 'A', false));
- assertFalse(Comparison.compareChars('a', 'A', true));
- assertFalse(Comparison.compareChars('A', 'a', true));
+ assertFalse(Comparison.isSameResidue('a', 'A', true));
+ assertFalse(Comparison.isSameResidue('A', 'a', true));
}
}