MockType (final MockVirtualMachine virtualMachine, PsiType type) { if (type instanceof PsiArrayType) { return new MockArrayType(createType(virtualMachine, ((PsiArrayType)type).getComponentType())); } if (type instanceof PsiPrimitiveType) { if (type.equals(PsiTypes.booleanType())) { return virtualMachine.getBooleanType(); } if (type.equals(PsiTypes.intType())) { return virtualMachine.getIntType(); } if (type.equals(PsiTypes.longType())) { return virtualMachine.getLongType(); } if (type.equals(PsiTypes.shortType())) { return virtualMachine.getShortType(); } if (type.equals(PsiTypes.voidType())) { return virtualMachine.getVoidType(); } } if (type instanceof PsiClassType) { PsiClass cls = PsiUtil.resolveClassInClassTypeOnly(type); if (cls != null) { return virtualMachine.createReferenceType(cls); } } throw new UnsupportedOperationException("create type for " + type); }