code: private static boolean checkOffset(String value, int offset, char expected) {
          return (offset < value.length()) && (value.charAt(offset) == expected);
      }
docs: Check if the expected character exist at the given offset in the value.
  
  @param value the string to check at the specified offset
  @param offset the offset to look for the expected character
  @param expected the expected character
  @return true if the expected character exist at the given offset