### Question:
NonNullHelper { public static boolean markAsNonNull(Type type, Annotations annotations) { return markAsNonNull(type, annotations, false); } private  NonNullHelper(); static boolean markAsNonNull(Type type, Annotations annotations); static boolean markAsNonNull(Type type, Annotations annotations, boolean ignorePrimativeCheck);  }### Answer:
@Test public void testNonNullString() throws Exception { Index complete = IndexCreator.index(AsyncApi.class); ClassInfo classByName = complete.getClassByName(DotName.createSimple(AsyncApi.class.getName())); MethodInfo nonNullString = classByName.method("nonNullString"); Type type = nonNullString.returnType(); Annotations annotationsForMethod = Annotations.getAnnotationsForMethod(nonNullString); assertTrue(NonNullHelper.markAsNonNull(type, annotationsForMethod)); }
@Test public void testNullableString() throws Exception { Index complete = IndexCreator.index(AsyncApi.class); ClassInfo classByName = complete.getClassByName(DotName.createSimple(AsyncApi.class.getName())); MethodInfo nonNullString = classByName.method("string"); Type type = nonNullString.returnType(); Annotations annotationsForMethod = Annotations.getAnnotationsForMethod(nonNullString); assertFalse(NonNullHelper.markAsNonNull(type, annotationsForMethod)); }
@Test public void testNonNullCompletionStage() throws Exception { Index complete = IndexCreator.index(AsyncApi.class); ClassInfo classByName = complete.getClassByName(DotName.createSimple(AsyncApi.class.getName())); MethodInfo nonNullString = classByName.method("nonNullCompletionStage"); Type type = nonNullString.returnType(); Annotations annotationsForMethod = Annotations.getAnnotationsForMethod(nonNullString); assertTrue(NonNullHelper.markAsNonNull(type, annotationsForMethod)); }