private static @NotNull Pair<String, String> parseAttributeInQuery(@NotNull String query, int end, @NotNull Ref<? super Integer> startPosition) {
    int index = end - 1;
    String value = null;

    while (index >= 0) {
      char ch = query.charAt(index);
      if (ch == ':') {
        value = query.substring(index + 1, end);
        startPosition.set(index + 1);
        end = index + 1;
        index--;
        while (index >= 0) {
          if (query.charAt(index) == ' ') {
            break;
          }
          index--;
        }
        break;
      }
      if (ch == ' ') {
        break;
      }
      index--;
    }

    if (startPosition.isNull()) {
      startPosition.set(index + 1);
    }

    return Pair.create(query.substring(index + 1, end), value);
  }
private static @NotNull Pair<String, String> parseAttributeInQuery(@NotNull String query, int end, @NotNull Ref<? super Integer> startPosition)