boon/src/main/java/org/boon/core/Conversions.java
public static Object unifyList(Object o, List list) {

        if (o==null) {
            return null;
        }


        if (list == null) {
            list = new ArrayList();
        }

        if (o instanceof Iterable) {
            Iterable i = ((Iterable) o);


            for (Object item : i) {

               unifyListOrArray(item, list);

            }



        } else {
            list.add(o);
        }

        return list;


    }
public static Object unifyList(Object o, List list) {

        if (o==null) {
            return null;
        }


        if (list == null) {
            list = new ArrayList();
        }

        if (o instanceof Iterable) {
            Iterable i = ((Iterable) o);


            for (Object item : i) {

               unifyListOrArray(item, list);

            }



        } else {
            list.add(o);
        }

        return list;


    }
This flattens a list.
@param o object that might be a list
@param list list to add o to or all of o's items to.
@return an object or a list