class Util {

	public static void inject(@Nonnull Object instance, @Nullable Object object, @Nonnull Field field) {
		if (object != null && !field.getType().isAssignableFrom(object.getClass())) {
			throw new IllegalArgumentException(
					"the object doesn't have the correct type to be assigable to the given field. The object is of type "
							+ object.getClass() + " and the field of " + field.getType());
		}

		try {
			FieldUtils.writeField(field, instance, object, true);
		} catch (IllegalAccessException e) {
			throw new InjectionException(object, instance, e);
		}
	}

	private  Util();

}