I'd use an existential type (`java.util.ArrayList[_]`) here to avoid the compiler warning.