You are not wrong. We should use instanceof.