code: private void validate(TaskDef taskDef) {
          Preconditions.checkNotNull(taskDef, "TaskDef object cannot be null");
          Preconditions.checkNotNull(taskDef.getName(), "TaskDef name cannot be null");
      }
docs: Use {@link Preconditions} to check for required {@link TaskDef} fields, throwing a Runtime exception if
  validations fail.
  
  @param taskDef The {@code TaskDef} to check.