I called a getElements method which returns Iterable.
getElements
Iterable
I did this:
List elements = (List
From exception message it is clear that Iterable is not castable to List
List
SO you need to return List from getElements()
getElements()