getContextValue with generic class