/*
 * Waltz - Enterprise Architecture
 * Copyright (C) 2016, 2017 Waltz open source project
 * See README.md for more information
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.khartec.waltz.common;

import org.junit.Test;

import java.util.Collection;

public class Checks_checkAll {

    @Test(expected = IllegalArgumentException.class)
    public void mustBeGivenAnArray() {
        Checks.checkAll((Object[]) null, x -> true, "test");
    }

    @Test(expected = IllegalArgumentException.class)
        public void mustBeGivenACollection() {
            Checks.checkAll((Collection<?>) null, x -> true, "test");
    }

    @Test(expected = IllegalArgumentException.class)
    public void mustBeGivenAPredicate() {
        Checks.checkAll(new String[]{}, null, "test");
    }


    @Test
    public void passesIfPredicateIsTrueForAll() {
        Checks.checkAll(new Integer[]{1, 3, 5}, x -> (x.intValue() % 2) == 1, "test");
    }

    @Test(expected = IllegalArgumentException.class)
    public void throwsIfPredicateIsFalseForAny() {
        Checks.checkAll(new Integer[]{1, 4, 5}, x -> (x.intValue() % 2) == 1, "test");
    }
}

@@ -1071,32 +1071,37 @@
 %22test%22);%0A    %7D%0A%0A
+    %0A
     @Test(expect
@@ -1137,20 +1137,16 @@
 .class)%0A
-    
     publ
@@ -1176,28 +1176,24 @@
 lection() %7B%0A
-    
         Chec
@@ -1245,32 +1245,37 @@
 %22test%22);%0A    %7D%0A%0A
+    %0A
     @Test(expect
@@ -1566,24 +1566,29 @@
 t%22);%0A    %7D%0A%0A
+    %0A
     @Test(ex

Update Checks_checkAll.java