Not able to get the item from the spinner

I tired with the below code-
// for open the list from the drop-down
driver.findElement(By.id(“id”)).click();

	// choose an item from the list by name.
	  driver.findElement(By.name("name")).click();

and it’s showing an error
like-
f != java.lang.String

i have also tried the below code:

List item = driver.findElements(By.xpath(“xpath”));
item.get(0).click();

this works partially, the zero(0) index does not show the exact zero(0) index data, it’s showing the different data.
when tried from the different index it’s showing
index 1 out of bounds for length 1
can anyone please help me out?

share page source of your screen here https://gist.github.com/