Throws a {@link NullPointerException} if the given object is null.
496341
@NonNull
  public static <T> T assertNotNull(T object, String item) {
    if (object == null) {
      throw new NullPointerException(item + " == null");
    }
    return object;
  }
5601
@Override
    public void writeObject(Object object)
        throws IOException
    {
        if (object == null) {
            writeNull();
            return;
        }

        Serializer serializer = findSerializerFactory().getObjectSerializer(object.getClass());

        serializer.writeObject(object, this);
    }
412020
public static void safeClose(@Nullable Object object) {
		if (object instanceof Closeable) {
			try {
				((Closeable) object).close();
			} catch (IOException e) {
				Exceptions.ignore(e);
			}
		}
	}
1119495
public void writeObject(Object object)
        throws IOException
    {
        if (object == null) {
            writeNull();
            return;
        }

        Serializer serializer;

        serializer = _serializerFactory.getSerializer(object.getClass());

        serializer.writeObject(object, this);
    }
1245598
@Override
    public void visitCode(Code obj) {
        try {
            userValues = new HashMap<>();
            loops = new HashMap<>();
            isInstanceMethod = !getMethod().isStatic();
            super.visitCode(obj);
        } finally {
            userValues = null;
            loops = null;
        }
    }
830313
public static void objectNotNull(Object object1, String name1, Object object2, String name2) {
        if (verify) {
            if (object1 == null || object2 == null) {
                throw new IllegalArgumentException(name1+":"+object1+"  "+name2+":"+object2);
            }
        }
    }
907578
public static void validateNotNull( Object object, String identifier )
        throws PostConditionException
    {
        if( object == null )
        {
            throw new PostConditionException( identifier + " was NULL." );
        }
    }
208915
public void setNullValue(String nullValue) {
        this.nullValue = nullValue;
        this.nullValueChars = nullValue.toCharArray();
        this.nullValueBytes = toBytes(nullValue, nullValue);
    }
1270398
@Override
  public void persist(Object obj) {
    if (null == obj) {
      throw new IllegalArgumentException("object to save cannot be null");
    }
    objMapper.saveObj(keyspace, obj);
  }
542500
private static void setValue(Object obj, String propertyPattern, Object value, ObjectWrapper options) {
        if (propertyPattern == null) {
            throw new IllegalArgumentException("Cannot set a new value to a property with a 'null' propertyPattern.");
        }

        if (obj == null) {
            // NullPointerException as it is throwed only when traversing a null object (ex: "foo.null.bar")
            throw new NullPointerException("Cannot set the value of '" + propertyPattern + "' to a 'null' object.");
        }

        // '.' position if positive, '[' inverse position if negative
        int position = indexOfDotOrSquare(propertyPattern);

        // (propertyPattern.contains("."))
        if (position > 0) {
            String leftPattern = propertyPattern.substring(0, position);
            String rightPattern = propertyPattern.substring(position + 1, propertyPattern.length());
            Object leftValue = getValue(obj, leftPattern, options);

            if (leftValue == null) {
                Property leftProperty = getPropertyOrThrow(Bean.forClass(obj.getClass()), leftPattern);

                if (options.isAutoInstancing) {
                    try {
                        leftValue = leftProperty.getType().newInstance();
                    } catch (Exception e) {
                        throw new ReflectionException("The value of " + leftProperty + " was 'null' in the object "
                                                              + obj.getClass().getName() + ". An attempt to invoke its 'no-args constructor'" +
                                                              " was made, but an error occurs.", e);
                    }

                    leftProperty.set(obj, leftValue);
                }
            }

            setValue(leftValue, rightPattern, value, options);
            // if (propertyPattern.contains("["))
        } else if (position < 0) {
            int squarePosition = -position;

            String leftPattern = propertyPattern.substring(0, squarePosition);
            String indexOrKey = propertyPattern.substring(squarePosition + 1, propertyPattern.length() - 1);// removes ']'
            Property leftProperty = getPropertyOrThrow(Bean.forClass(obj.getClass()), leftPattern);

            if (leftProperty.getType().isAssignableFrom(Map.class)) {
                setMappedValue(obj, leftProperty, indexOrKey, value, options);
            } else {
                try {
                    setIndexedValue(obj, leftProperty, Integer.parseInt(indexOrKey), value, options);
                } catch (NumberFormatException e) {
                    throw new IllegalArgumentException("The pattern '" + indexOrKey + "' for the indexed "
                                                               + leftProperty + " is invalid. Cannot parse the string to a valid integer index.");
                }
            }
        } else {
            setSimpleValue(obj, getPropertyOrThrow(Bean.forClass(obj.getClass()), propertyPattern), value);
        }
    }
653773
public static boolean isAnyNull(Object... _objects) {
        if (_objects == null) {
            return true;
        }
        for (Object obj : _objects) {
            if (obj == null) {
                return true;
            }
        }
        return false;
    }
794020
private static void checkPreconditions(final Set<Object> possibleValues) {
		if( possibleValues == null ) {
			throw new NullPointerException("possibleValues Set should not be null");
		} else if( possibleValues.isEmpty() ) {
			throw new IllegalArgumentException("possibleValues Set should not be empty");
		}
	}
552119
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
		in.defaultReadObject();
		this.nullMask = new boolean[fieldSerializers.length];
	}
515334
@Override
    public boolean containsKey(Object key) {
        if (key == null) {
            throw new NullPointerException("Key can not be null");
        }
        if (!(key instanceof String)) {
            throw new ClassCastException("Only String keys are supported -- got " + key.getClass());
        }

        return get(key) != null;
    }
493885
static void assertNotNull(String message, Object nonNullObject)
    {
        if(nonNullObject == null)
        {
            System.err.println(message);
        }
    }
315560
private void nullPrintln(PrintStream out, String line)
    {
        if (out != null)
        {
            out.println(line);
        }
    }
431270
public static void assertNull(Object object) {
		if (imp != null && object != null) {
			imp.assertFailed(StringUtils.format("Expected 'null' but was '%s'", object));
		}
	}