private static void checkOffset(String value,int offset,char expected) throws IndexOutOfBoundsException {
  char found=value.charAt(offset);
  if (found != expected) {
    throw new IndexOutOfBoundsException("Expected '" + expected + "' character but found '"+ found+ "'");
  }
}

private static void checkOffset ( String value , int offset , char expected ) throws IndexOutOfBoundsException { char found = value . charAt ( offset ) ; if ( found != expected ) { throw new IndexOutOfBoundsException ( "Expected '" + expected + "' character but found '" + found + "'" ) ; } }
check if the expected character exist at the given offset of the
