I want to call a method using a collection of objects that all implement the same interface. Is this possible?
public class GenericsTest {
    public void main() {
        ArrayList<Strange> thisWorks = new ArrayList<>();
        isAllStrange(thisWorks);
        ArrayList<Person> thisDoesNot = new ArrayList<>();
        isAllStrange(thisDoesNot);
    }
    public boolean isAllStrange(ArrayList<Strange> strangeCollection) {
        for (Strange object : strangeCollection) {
            if (object.isStrange())
                return true;
        }
        return false;
    }
    public interface Strange {
        public boolean isStrange();
    }
    public class Person implements Strange {
        public boolean isStrange() {
            return true;
        }
    }
}
 
     
     
    