void () { PsiField field = myClass.findFieldByName("LONG_CONST1", false); assertNotNull(field); PsiLiteralExpression initializer = (PsiLiteralExpression)field.getInitializer(); assertNotNull(initializer); assertEquals("2", initializer.getText()); assertEquals(PsiTypes.intType(), initializer.getType()); assertEquals(Integer.valueOf(2), initializer.getValue()); assertEquals(Long.valueOf(2), field.computeConstantValue()); }