instanceof operator and Visitor pattern replacement in Java 8