QuadriPredicateTest.java
1    /* 
2     * Copyright (c) Waoss 
3     * 
4     * Mail me at rahul29112002@gmail.com for any queries :) 
5     * 
6     * This is free software licensed under the GNU General Public License.This license allows one to modify it on their will and also embed it or distribute it along with their own software. 
7     * 
8     * It is distributed in the hope that it shall be useful to whomsoever receives it,but does not provide ANY warranty or liability,not even the gurantee that the software will work in your certain usage. 
9     * You receive a copy of the GNU General Public License version 3.0 when you download this software.See LICENSE.MD for more details. 
10    */ 
11    
12   package com.waoss.util.fids; 
13    
14   import org.junit.Test; 
15    
16   import static org.junit.Assert.assertEquals; 
17    
18   public class QuadriPredicateTest { 
19    
20       QuadriPredicate<String, String, String, String> equalsPredicate = (t, u, v, s) -> t.equals(u) && u.equals(v) && v.equals(s); 
21    
22       @Test 
23       public void test() throws Exception {
24           assertEquals(true, equalsPredicate.test("", "", "", ""));
25       } 
26    
27       @Test 
28       public void and() throws Exception {
29           assertEquals(true, equalsPredicate.and((t, u, v, s) -> t.equalsIgnoreCase(u) && u.equalsIgnoreCase(v) && v.equalsIgnoreCase(s)).test("", "", "", ""));
30       } 
31    
32       @Test 
33       public void negate() throws Exception {
34           assertEquals(false, equalsPredicate.negate().test("", "", "", ""));
35       } 
36    
37       @Test 
38       public void or() throws Exception {
39           assertEquals(true, equalsPredicate.or(equalsPredicate.negate()).test("", "", "", ""));
40       } 
41    
42   }