code: static List<Point> find(
          String text, String query, boolean ignoreCase)
      {
          List<Point> appearances = new ArrayList<Point>();
          int offset = StringUtils.indexOf(text, query, 0, ignoreCase);
          int length = query.length();
          while (offset != -1)
          {
              appearances.add(new Point(offset, offset + length));
              offset = StringUtils.indexOf(text, query, offset + 1, ignoreCase);
          }
          return appearances;
      }
docs: Find all appearances of the given query in the given text. The
  result will be points <code>(startIndex, endIndex)</code> indicating
  the appearances.
  
  @param text The text
  @param query The query
  @param ignoreCase Whether the case should be ignored
  @return The appearances