Check out example codes for "how to iterate list in java selenium". It will help you in understanding the concepts better.

Code Example 1

Iterator<WebElement> itr = allLinks.iterator();
while(itr.hasNext()) {
    System.out.println(itr.next().getText());
}

Code Example 2

public Boolean selectByText( String text ) {
    WebElement dropDown = driver.findElement( By.xpath( ".//dropdown/path" ) );
    dropDown.click();
    List<WebElement> allOptions = dropDown.findElements(By.xpath(".//option"));
    for ( WebElement we: allOptions) { 
        dropDown.sendKeys( Keys.DOWN ); //simulate visual movement
        sleep(250);       
        if ( we.getText().contains( text ) ) select.selectByVisibleText("Value1");
    }
}

Learn ReactJs, React Native from akashmittal.com