Exemplo n.º 1
0
  @Test
  public void testNotNull() throws Exception {
    Predicate<Object> notNull = Predicates.notNull();

    assertTrue(notNull.test("Hallo"));
    assertFalse(notNull.test(null));
  }
Exemplo n.º 2
0
  @Test
  public void testIsNull() throws Exception {
    Predicate<Object> isNull = Predicates.isNull();

    assertTrue(isNull.test(null));
    assertFalse(isNull.test("test"));
  }
Exemplo n.º 3
0
  @Test
  public void testAlwaysTrue() {
    Predicate<Object> alwaysTrue = Predicates.alwaysTrue();

    assertTrue(alwaysTrue.test(null));
    assertTrue(alwaysTrue.test("Hallo"));
    assertTrue(alwaysTrue.test(55l));
  }
Exemplo n.º 4
0
  @Test
  public void testAlwaysFalse() {
    Predicate<Object> alwaysFalse = Predicates.alwaysFalse();

    assertFalse(alwaysFalse.test(null));
    assertFalse(alwaysFalse.test("FooBar"));
    assertFalse(alwaysFalse.test(66d));
  }