private static @Nullable PsiClass getKeyClass(@NotNull PsiType fieldType) {
      PsiType[] parameters = fieldType instanceof PsiClassType ?
                             ((PsiClassType)fieldType).getParameters() :
                             PsiType.EMPTY_ARRAY;

      PsiType parameterType = getFirstElement(parameters);

      PsiType boundType = parameterType instanceof PsiWildcardType ?
                          ((PsiWildcardType)parameterType).getBound() :
                          null;

      return getPsiClass(boundType == null ? parameterType : boundType);
    }
private static @Nullable PsiClass getKeyClass(@NotNull PsiType fieldType)