// Path: src/main/java/com/frameworkium/core/ui/pages/PageFactory.java
// public class PageFactory {
// 
//   private static final Logger logger = LogManager.getLogger();
// 
//   protected PageFactory() {
//   }
// 
//   public static <T extends BasePage<T>> T newInstance(Class<T> clazz) {
//     return instantiatePageObject(clazz).get();
//   }
// 
//   public static <T extends BasePage<T>> T newInstance(
//       Class<T> clazz, Duration timeout) {
//     return instantiatePageObject(clazz).get(timeout);
//   }
// 
//   public static <T extends BasePage<T>> T newInstance(
//       Class<T> clazz, String url) {
//     return instantiatePageObject(clazz).get(url);
//   }
// 
//   public static <T extends BasePage<T>> T newInstance(
//       Class<T> clazz, String url, Duration timeout) {
//     return instantiatePageObject(clazz).get(url, timeout);
//   }
// 
//   private static <T extends BasePage<T>> T instantiatePageObject(Class<T> clazz) {
//     try {
//       return clazz.getDeclaredConstructor().newInstance();
//     } catch (InstantiationException | IllegalAccessException
//         | NoSuchMethodException | InvocationTargetException e) {
//       logger.fatal("Unable to instantiate PageObject", e);
//       throw new IllegalStateException("Unable to instantiate PageObject", e);
//     }
//   }
// }


import com.frameworkium.core.ui.annotations.Visible;
import com.frameworkium.core.ui.pages.BasePage;
import com.frameworkium.core.ui.pages.PageFactory;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.CacheLookup;
import org.openqa.selenium.support.FindBy;
import java.util.List;
import java.util.Objects;
import java.util.stream.IntStream;
import java.util.stream.Stream;
package com.frameworkium.integration.wikipedia.pages;



/**
 * This page uses {@link List}s of {@link WebElement}s for the columns we know
 * that we need. This test is faster than using StreamTable, especially when
 * running over a grid due to the far fewer page lookups required.
 *
 * <p>This is a trade-off between readability, maintainability and performance.
 *
 * <p>This approach is great if the table and tests are unlikely to change often.
 */
public class EnglishCountiesUsingListsPage extends BasePage<EnglishCountiesUsingListsPage> {

    @Visible(checkAtMost = 1)
    @CacheLookup
    @FindBy(css = "table.wikitable > tbody > tr > td:nth-child(1)")
    private List<WebElement> countyColumn;

    @CacheLookup
    @FindBy(css = "table.wikitable > tbody > tr > td:nth-child(2)")
    private List<WebElement> populationColumn;

    @CacheLookup
    @FindBy(css = "table.wikitable > tbody > tr > td:nth-child(7)")
    private List<WebElement> densityColumn;

    public static EnglishCountiesUsingListsPage open() {
// Path: src/main/java/com/frameworkium/core/ui/pages/PageFactory.java
// public class PageFactory {
// 
//   private static final Logger logger = LogManager.getLogger();
// 
//   protected PageFactory() {
//   }
// 
//   public static <T extends BasePage<T>> T newInstance(Class<T> clazz) {
//     return instantiatePageObject(clazz).get();
//   }
// 
//   public static <T extends BasePage<T>> T newInstance(
//       Class<T> clazz, Duration timeout) {
//     return instantiatePageObject(clazz).get(timeout);
//   }
// 
//   public static <T extends BasePage<T>> T newInstance(
//       Class<T> clazz, String url) {
//     return instantiatePageObject(clazz).get(url);
//   }
// 
//   public static <T extends BasePage<T>> T newInstance(
//       Class<T> clazz, String url, Duration timeout) {
//     return instantiatePageObject(clazz).get(url, timeout);
//   }
// 
//   private static <T extends BasePage<T>> T instantiatePageObject(Class<T> clazz) {
//     try {
//       return clazz.getDeclaredConstructor().newInstance();
//     } catch (InstantiationException | IllegalAccessException
//         | NoSuchMethodException | InvocationTargetException e) {
//       logger.fatal("Unable to instantiate PageObject", e);
//       throw new IllegalStateException("Unable to instantiate PageObject", e);
//     }
//   }
// }


// Path: src/test/java/com/frameworkium/integration/wikipedia/pages/EnglishCountiesUsingListsPage.java
import com.frameworkium.core.ui.annotations.Visible;
import com.frameworkium.core.ui.pages.BasePage;
import com.frameworkium.core.ui.pages.PageFactory;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.CacheLookup;
import org.openqa.selenium.support.FindBy;
import java.util.List;
import java.util.Objects;
import java.util.stream.IntStream;
import java.util.stream.Stream;

package com.frameworkium.integration.wikipedia.pages;



/**
 * This page uses {@link List}s of {@link WebElement}s for the columns we know
 * that we need. This test is faster than using StreamTable, especially when
 * running over a grid due to the far fewer page lookups required.
 *
 * <p>This is a trade-off between readability, maintainability and performance.
 *
 * <p>This approach is great if the table and tests are unlikely to change often.
 */
public class EnglishCountiesUsingListsPage extends BasePage<EnglishCountiesUsingListsPage> {

    @Visible(checkAtMost = 1)
    @CacheLookup
    @FindBy(css = "table.wikitable > tbody > tr > td:nth-child(1)")
    private List<WebElement> countyColumn;

    @CacheLookup
    @FindBy(css = "table.wikitable > tbody > tr > td:nth-child(2)")
    private List<WebElement> populationColumn;

    @CacheLookup
    @FindBy(css = "table.wikitable > tbody > tr > td:nth-child(7)")
    private List<WebElement> densityColumn;

    public static EnglishCountiesUsingListsPage open() {
        return PageFactory.newInstance(EnglishCountiesUsingListsPage.class,