Experimenting with instanceof using method reference. Don't think it can be made as clean.