### Question:
Inventory { public List<String> getAllOwnedSkus() { return new ArrayList<String>(mPurchaseMap.keySet()); }  SkuDetails getSkuDetails(String sku); Collection<SkuDetails> getSkuDetails(); Purchase getPurchase(String sku); boolean hasPurchase(String sku); boolean hasDetails(String sku); void erasePurchase(String sku); List<String> getAllOwnedSkus(); List<String> getAllOwnedSkus(ItemType itemType); List<Purchase> getAllPurchases(); void addSkuDetails(SkuDetails d); void addPurchase(Purchase p); @Override String toString();  }### Answer:
@Test public void testGetAllOwnedSkus() 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"); }