instanceof doesn't work with generic