ProductItems { public static Function<ProductItem, String> description() { return new Function<ProductItem, String>() { @Override public String apply(ProductItem productItem) { return productItem.getDescription(); } }; }  static Function<ProductItem, Float> capacity(); static Function<ProductItem, String> description(); static Function<ProductItem, ProductItemPrice> price(); static Function<ProductItemPrice, ProductItem> item();  }
@Test public void testDescription() { assertEquals(description().apply(item),"an item"); }
@Test public void testDescriptionMissing() { ProductItem item = ProductItem.builder().id(1).build(); assertNull(description().apply(item)); }