public static Function<ProductItemPrice, ProductItem> item() {
return new Function<ProductItemPrice, ProductItem>() {
@Override
public ProductItem apply(ProductItemPrice productItemPrice) {
Set<ProductItemCategory> categories = productItemPrice.getCategories();
ProductItem item = productItemPrice.getItem();
ProductItem.Builder builder = productItemPrice.getItem().toBuilder();
if (item.getCategories().size() == 0 && categories.size() != 0) {
builder.categories(categories);
}
return builder.build();
}