This does not compile, any suggestion appreciated.
... List list = getList(); return (List) list;
Compil
Another approach would be using a java 8 stream.
List customer = myObjects.stream() .filter(Customer.class::isInstance) .map(Customer.class::cast) .collect(toList());