void () { PsiClass clazz = myFixture.addClass("final class Foo { void foo(String s) { s.hashCode(); } }"); PsiParameter parameter = clazz.getMethods()[0].getParameterList().getParameters()[0]; NullableNotNullManager manager = NullableNotNullManager.getInstance(parameter.getProject()); String javax = "javax.annotation.Nonnull"; manager.setDefaultNotNull(javax); try { assertEquals(javax, manager.findOwnNullabilityInfo(parameter).getAnnotation().getQualifiedName()); } finally { manager.setDefaultNotNull(AnnotationUtil.NOT_NULL); } }