Perform binding to interface only if implementation type is not null.
547333
private <T> void bindIfNotNull(final Class<T> interfaceType, @Nullable final Class<? extends T> implementationType) {
        if (implementationType != null) {
            bind(interfaceType).to(implementationType);
        }
    }
1210703
@NonNull
    public static <T> T nonNull(@Nullable T obj) {
        if (obj == null) {
           throw new IllegalArgumentException("encountered illegal null value");
        }
        return obj;
    }
966378
private void _badType(int type, Object value)
    {
        if (type < 0) {
            throw new IllegalStateException(String.format(
                    "Internal error: missing BeanDefinition for id %d (class %s)",
                    type, value.getClass().getName()));
        }
        String typeDesc = (value == null) ? "NULL" : value.getClass().getName();
        throw new IllegalStateException(String.format("Unsupported type: %s (%s)", type, typeDesc));
    }
1291718
public static <T> TypeAdapter<T> nullSafeClone(@NonNull final TypeAdapter<T> delegate) {
    return new TypeAdapter<T>() {
      @Nullable @Override public T readFromParcel(@NonNull Parcel source) {
        return readNullable(source, delegate);
      }

      @Override public void writeToParcel(@Nullable T value, @NonNull Parcel dest, int flags) {
        writeNullable(value, dest, flags, delegate);
      }
    };
  }
80727
private Class<?> resolveResultJavaType(Class<?> resultType, String property, Class<?> javaType) {
    if (javaType == null && property != null) {
      try {
        MetaClass metaResultType = MetaClass.forClass(resultType, REFLECTOR_FACTORY);
        javaType = metaResultType.getSetterType(property);
      } catch (Exception ignored) {
        // ignore, following null check statement will deal with the
        // situation
      }
    }
    if (javaType == null) {
      javaType = Object.class;
    }
    return javaType;
  }
1201290
@Override
	@Nullable
	public String getMapping(Class<?> type, Method method) {

		Assert.notNull(type, "Type must not be null!");
		Assert.notNull(method, "Method must not be null!");

		String[] mapping = getMappingFrom(findMergedAnnotation(method, annotationType));
		String typeMapping = getMapping(type);

		if (mapping.length == 0) {
			return typeMapping;
		}

		return typeMapping == null || "/".equals(typeMapping) ? mapping[0] : join(typeMapping, mapping[0]);
	}
290184
private BindingProperty findMatchingBindingProperty( final List<BindingProperty> bindings,
                                                       final BindingProperty requirement )
  {
    for ( final BindingProperty candidate : bindings )
    {
      if ( requirement.getName().equals( candidate.getName() ) )
      {
        return candidate;
      }
    }
    return null;
  }
1110208
private void checkForNull(String name, Object value) {
        if(name == null) {
            throw new NullPointerException("name must not be null");
        }
        if(value == null) {
            throw new NullPointerException("value must not be null");
        }
    }
917466
boolean mark(ProtoType type) {
    if (type == null) throw new NullPointerException("type == null");
    if (identifierSet.excludes(type)) return false;
    return types.add(type);
  }
1019269
public static Condition<?, ?> isType(final Class<?> type) {
    return new Condition<Object, Object>() {
      public boolean applies(MappingContext<Object, Object> context) {
        return type.isAssignableFrom(context.getSourceType());
      }
    };
  }
502730
private AbstractManagedType getType(Class clazz, boolean isIdClass)
    {
        if (clazz != null && !clazz.equals(Object.class))
        {
            return processInternal(clazz, isIdClass);
        }
        return null;
    }
196870
private static <T> void checkPreconditions(final Class<T> type, final TextParser<T> parser) {
        if(type == null) {
            throw new NullPointerException("type is null.");
        }
        
        if(parser == null) {
            throw new NullPointerException("parser is null.");
        }
    }
701880
public static boolean isBindedObject(BindProperty property) {
		BindTransform t = lookup(property);

		if (t != null && t instanceof ObjectBindTransform) {
			return true;
		}
		return false;
	}
433532
public void notThrown(Class<? extends Throwable> type) {
    Throwable thrown = getSpecificationContext().getThrownException();
    if (thrown == null) return;
    if (type.isAssignableFrom(thrown.getClass())) {
      throw new UnallowedExceptionThrownError(type, thrown);
    }
    ExceptionUtil.sneakyThrow(thrown);
  }
805259
public static IsNullValue noKaboomNonNullValue(@Nonnull Location ins) {
        if (ins == null) {
            throw new NullPointerException("ins cannot be null");
        }
        return new IsNullValue(NO_KABOOM_NN, ins);
    }
675749
@Nullable
	@Override
	public String getMapping(Class<?> type, Method method) {

		String key = key(type, method);

		return MAPPINGS.computeIfAbsent(key, __ -> delegate.getMapping(type, method));
	}
437768
private void init(Class<?> type) {

    ParameterizedType parameterizedType =
      stream(nullSafeArray(type.getGenericInterfaces(), Type.class))
        .filter(this::isParameterizedFunctionType)
        .findFirst()
        .map(it -> (ParameterizedType) it)
        .orElseGet(() -> {

          Type genericSuperclass = type.getGenericSuperclass();

          return isParameterizedFunctionType(genericSuperclass) ? (ParameterizedType) genericSuperclass : null;

        });

    this.sourceType = parameterizedType != null
      ? ClassUtils.toRawType(parameterizedType.getActualTypeArguments()[0])
      : Object.class;

    this.targetType = parameterizedType != null
      ? ClassUtils.toRawType(parameterizedType.getActualTypeArguments()[1])
      : Object.class;
  }