code: public static String getXPathForHeaderRowByHeaders(String columnName, String... extraColumnNames) {
          String allHeadersPresent;
          if (extraColumnNames != null && extraColumnNames.length > 0) {
              int extraCount = extraColumnNames.length;
              String[] columnNames = new String[extraCount + 1];
              columnNames[0] = columnName;
              System.arraycopy(extraColumnNames, 0, columnNames, 1, extraCount);
  
              allHeadersPresent = Stream.of(columnNames)
                      .map(GridBy::getXPathForHeaderCellWithText)
                      .collect(Collectors.joining(" and "));
          } else {
              allHeadersPresent = getXPathForHeaderCellWithText(columnName);
          }
          return String.format("/tr[%1$s]", allHeadersPresent);
      }
docs: Creates an XPath expression that will find a header row, selecting the row based on the
  header texts present.
  @param columnName first header text which must be present.
  @param extraColumnNames name of other header texts that must be present in table's header row.
  @return XPath expression selecting a tr in the row