private static @NonNls String getBoxedWrapper(final PsiType from, final PsiType to, @NotNull @NonNls String arg) {
    final PsiClassType.ClassResolveResult resolveResult = PsiUtil.resolveGenericsClassInType(to);
    final PsiClass atomicClass = resolveResult.getElement();
    LOG.assertTrue(atomicClass != null);
    final PsiTypeParameter[] typeParameters = atomicClass.getTypeParameters();
    if (typeParameters.length == 1) {
      final PsiSubstitutor substitutor = resolveResult.getSubstitutor();
      LOG.assertTrue(substitutor.isValid());
      final PsiType initial = substitutor.substitute(typeParameters[0]);
      final PsiPrimitiveType unboxedInitialType = PsiPrimitiveType.getUnboxedType(initial);
      if (unboxedInitialType != null) {
        if (from instanceof PsiPrimitiveType) {
          final PsiClassType boxedFromType = ((PsiPrimitiveType)from).getBoxedType(atomicClass);
          LOG.assertTrue(boxedFromType != null);
          return "new " + initial.getPresentableText() + "((" + unboxedInitialType.getCanonicalText() + ")(" + arg + "))";
        }
      }
    }
    return arg;
  }
private static @NonNls String getBoxedWrapper(final PsiType from, final PsiType to, @NotNull @NonNls String arg)