char (char aChar) { boolean isUpperCase = AsciiUtils.isUpperAscii(aChar); char lc = isUpperCase ? AsciiUtils.toLowerAscii(aChar) : aChar; for (char[] line : keyboard) { for (int j = 0; j < line.length; j++) { char c = line[j]; if (c == lc) { if (j + 1 < line.length) { return isUpperCase ? AsciiUtils.toUpperAscii(line[j + 1]) : line[j + 1]; } else { return 0; } } } } return 0; }