public static boolean isNullable(Injectee injectee) {
    // HK2's optional
    if (injectee.isOptional()) {
      return true;
    }
    
    // Guice's optional
    AnnotatedElement element = injectee.getParent();
    if (isGuiceOptional(element)) {
      return true;
    }
    
    // Any @Nullable?
    int position = injectee.getPosition();
    
    if (element instanceof Field) {
      return Nullability.allowsNull(((Field)element).getAnnotations());
      
    } else if (element instanceof Method) {
      Annotation annotations[][] = ((Method)element).getParameterAnnotations();
      return Nullability.allowsNull(annotations[position]);
      
    } else if (element instanceof Constructor<?>) {
      Annotation annotations[][] = ((Constructor<?>)element).getParameterAnnotations();
      return Nullability.allowsNull(annotations[position]);
    }
    
    return false;
  }
public static boolean isNullable(Injectee injectee) {
    
    if (injectee.isOptional()) {
      return true;
    }
    
    
    AnnotatedElement element = injectee.getParent();
    if (isGuiceOptional(element)) {
      return true;
    }
    
    
    int position = injectee.getPosition();
    
    if (element instanceof Field) {
      return Nullability.allowsNull(((Field)element).getAnnotations());
      
    } else if (element instanceof Method) {
      Annotation annotations[][] = ((Method)element).getParameterAnnotations();
      return Nullability.allowsNull(annotations[position]);
      
    } else if (element instanceof Constructor<?>) {
      Annotation annotations[][] = ((Constructor<?>)element).getParameterAnnotations();
      return Nullability.allowsNull(annotations[position]);
    }
    
    return false;
  }
public static boolean isNullable ( Injectee injectee ) { // HK2's optional if ( injectee . isOptional ( ) ) { return true ; } // Guice's optional AnnotatedElement element = injectee . getParent ( ) ; if ( isGuiceOptional ( element ) ) { return true ; } // Any @Nullable? int position = injectee . getPosition ( ) ; if ( element instanceof Field ) { return Nullability . allowsNull ( ( ( Field ) element ) . getAnnotations ( ) ) ; } else if ( element instanceof Method ) { Annotation annotations [ ] [ ] = ( ( Method ) element ) . getParameterAnnotations ( ) ; return Nullability . allowsNull ( annotations [ position ] ) ; } else if ( element instanceof Constructor < ? > ) { Annotation annotations [ ] [ ] = ( ( Constructor < ? > ) element ) . getParameterAnnotations ( ) ; return Nullability . allowsNull ( annotations [ position ] ) ; } return false ; }
Returns {@code true} if the given {@link Injectee} can be {@code null}.

@see Optional
@see Injectee#isOptional()
@see Nullable
@see com.google.inject.Inject#optional()
@see Nullability#allowsNull(Annotation[])
Returns { @code true } if the given { @link Injectee } can be { @code null } .