|
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 TriPredicateTest { 19 20 TriPredicate<Integer, Integer, Integer> triPredicate = (a, b, c) -> a == b && b == c; 21 22 @Test 23 public void test() throws Exception { 24 assertEquals(true, triPredicate.test(5, 5, 5)); 25 } 26 27 @Test 28 public void and() throws Exception { 29 assertEquals(false, triPredicate.and((a, b, c) -> a == b && b > c).test(45, 41, 2)); 30 } 31 32 @Test 33 public void negate() throws Exception { 34 assertEquals(false, triPredicate.negate().test(5, 5, 5)); 35 } 36 37 @Test 38 public void or() throws Exception { 39 assertEquals(true, triPredicate.or((a, b, c) -> a == b && b == c).test(6, 6, 6)); 40 } 41 42 }