testtypepredicate.java

来自「一个关于java 的常用工具包」· Java 代码 · 共 39 行

JAVA
39
字号
package org.jutiltest.predicate;import org.jutil.junit.JutilTest;import org.jutil.junit.CVSRevision;import org.jutil.predicate.TypePredicate;import org.jutil.predicate.Predicate;import org.jutil.predicate.Or;import org.jutil.predicate.And;import org.jutil.predicate.PrimitiveTotalPredicate;import org.jutil.predicate.TotalPredicate;import org.jutil.predicate.NegationAsFailure;import java.util.Collection;import java.util.ArrayList;public class TestTypePredicate extends JutilTest {  public TestTypePredicate(String name) {    super(name, new CVSRevision("1.3"));  }  public void setup() {  }  public void testTypePredicate() {    Collection and = new ArrayList();    Collection or = new ArrayList();    and.add(new And());    and.add(new And());    and.add(new And());    and.add(new And());    or.add(new Or());    or.add(new Or());    or.add(new Or());    assertTrue(new TypePredicate(And.class).forall(and));    assertTrue(new TypePredicate(Or.class).forall(or));    assertTrue(! new TypePredicate(And.class).exists(or));    assertTrue(! new TypePredicate(Or.class).exists(and));  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?