Exemplo n.º 1
0
  @Test
  public void testIdentity() throws Exception {
    Collection<Object> objects = new ArrayList<>();

    objects.add("Hallo");
    objects.add(55);
    objects.add(new ArithmeticException());

    io.freefair.util.function.Function<Object, Object> identity =
        io.freefair.util.function.Functions.identity();

    for (Object obj : objects) {
      assertSame(obj, identity.apply(obj));
    }
  }