Use of wildcard to properly implement the generic