import java.util.Map;
import java.util.TreeMap;

public class InvoiceMap {
	private Map<String, InvoiceList> invoices;
	
	public InvoiceMap() {
		this.invoices = new TreeMap<String, InvoiceList>();
	}
	
	public void add(Invoice inv) {
		String salesPerson = inv.getSalesPerson().toLowerCase();
	    if (!this.invoices.containsKey(salesPerson)) {
				this.invoices.put(salesPerson, new InvoiceList());
		}
		this.invoices.get(salesPerson).add(inv);
	}
	
	public InvoiceList lookup(String salesPerson) {
		InvoiceList invList = this.invoices.get(salesPerson.toLowerCase());
		if (invList == null) {
			return new InvoiceList();
		}
		else {
			return invList;
		}
	}
}
