I have an interface A:
interface A {
}
Then I have a class B:
class B implements A {
}
Then I have a method that uses a list of A:
void process(ArrayList<A> myList) {
}
I want to pass it a list of B:
ArrayList<B> items = new ArrayList<B>();
items.add(new B());
process(items);
But then there is an error that types do not match. I understand why. ArrayList is a type itself and it has not function to convert from ArrayList<B> to ArrayList<A>. Is there a quick and resource-wise light way to form a new array that is suitable to be passed to my process method?