@Test public void testErasePurchase() throws Exception {

    Inventory inventory = new Inventory();
    Purchase p1 = mock(Purchase.class);
    when(p1.getSku()).thenReturn("sku1");
    Purchase p2 = mock(Purchase.class);
    when(p2.getSku()).thenReturn("sku2");
    inventory.addPurchase(p1);
    inventory.addPurchase(p2);
    assertThat(inventory.getAllOwnedSkus()).containsOnly("sku1", "sku2");
    inventory.erasePurchase("sku1");
    assertThat(inventory.getAllOwnedSkus()).containsOnly("sku2");
}