/*
 * Copyright 2011 Vincent Behar
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.rundeck.api.util;

import org.apache.commons.lang.StringUtils;

/**
 * Utility class for assertions
 * 
 * @author Vincent Behar
 */
public class AssertUtil {

    /**
     * Test if the given {@link Object} is null
     * 
     * @param object
     * @param errorMessage to be used if the object is null
     * @throws IllegalArgumentException if the given object is null
     */
    public static void notNull(Object object, String errorMessage) throws IllegalArgumentException {
        if (object == null) {
            throw new IllegalArgumentException(errorMessage);
        }
    }

    /**
     * Test if the given {@link String} is blank (null, empty or only whitespace)
     * 
     * @param input string
     * @param errorMessage to be used if the string is blank
     * @throws IllegalArgumentException if the given string is blank
     */
    public static void notBlank(String input, String errorMessage) throws IllegalArgumentException {
        if (StringUtils.isBlank(input)) {
            throw new IllegalArgumentException(errorMessage);
        }
    }

}

@@ -666,16 +666,94 @@
 Utils;%0A%0A
+import java.util.Arrays;%0Aimport java.util.Collection;%0Aimport java.util.List;%0A%0A
 /**%0A * U
@@ -782,17 +782,16 @@
 tions%0A *
- 
 %0A * @aut
@@ -839,16 +839,717 @@
 Util %7B%0A%0A
+    /**%0A     * Test if the given value is in the list%0A     *%0A     * @param errorMessage message%0A     * @param value        value%0A     * @param list         list%0A     */%0A    public static void inList(String errorMessage, Object value, List%3CObject%3E list) %7B%0A        if (!list.contains(value)) %7B%0A            throw new IllegalArgumentException(errorMessage + %22: %22 + list);%0A        %7D%0A    %7D%0A%0A    /**%0A     * Test if the given value is in the list%0A     *%0A     * @param errorMessage message%0A     * @param value        value%0A     * @param list         list%0A     */%0A    public static void inList(String errorMessage, Object value, Object... list) %7B%0A        inList(errorMessage, value, Arrays.asList(list));%0A    %7D%0A
     /**%0A
@@ -1598,25 +1598,24 @@
  null%0A     *
- 
 %0A     * @par
@@ -2060,23 +2060,22 @@
 espace)%0A
+
      *
- 
 %0A     * 

Add inList assertion