import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

interface CartCalculator {
	public Object calculate();
}

interface CartItemCalculator {
	public Object calculate(List<Item> itemList);
}


class Item {
	private String name;
	private int price;
	private List<String> categories;
	
	public String getName() { return name; }
	public Integer getPrice() { return price; }
	public List<String> getCategories() { return categories; }
	
	Item(String name, Integer price, List<String> categories) {
		this.name = name; 
		this.price = price;
		this.categories = categories;
	}
}

public class Main {
	public static void main(String []args) {
		List<Item> itemList = Arrays.asList(
				new Item[]{
					new Item("Webcam", 27, Arrays.asList("Accessory", "Multimedia")),
					new Item("Core i5", 99, Arrays.asList("Component", "CPU")),
					new Item("Core i7", 199, Arrays.asList("Component", "CPU")),
					new Item("Core i9", 299, Arrays.asList("Component", "CPU")),
					new Item("Asus H310", 149, Arrays.asList("Component", "MB")),
					new Item("Asus H510", 95, Arrays.asList("Component", "MB")),
					new Item("GB2 Pro 13", 1149, Arrays.asList("Notebook")),
					new Item("Book Air", 1349, Arrays.asList("Notebook")),
					new Item("ADA", 1349, Arrays.asList("Notebook")),
				});
		
        Cart c = new Cart(itemList);
        System.out.println(c.calculate());
	}
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: