InAppBillingV3Vendor implements Vendor { @Override public void getInventory(Context context, Collection<String> inappSkus, Collection<String> subSkus, InventoryListener listener) { if (context == null || listener == null) { throw new IllegalArgumentException("Context or listener is null"); } throwIfUninitialized(); final List<String> inappSkusList = inappSkus == null ? null : new ArrayList<>(inappSkus); final List<String> subSkusList = subSkus == null ? null : new ArrayList<>(subSkus); final Inventory inventory = new Inventory(); try { log("Querying inventory..."); inventory.addPurchases(getPurchases(PRODUCT_TYPE_ITEM)); inventory.addPurchases(getPurchases(PRODUCT_TYPE_SUBSCRIPTION)); if (inappSkusList != null && !inappSkusList.isEmpty()) { inventory.addProducts(getProductsWithType(inappSkusList, PRODUCT_TYPE_ITEM)); } if (subSkusList != null && !subSkusList.isEmpty()) { inventory.addProducts(getProductsWithType(subSkusList, PRODUCT_TYPE_SUBSCRIPTION)); } listener.success(inventory); } catch (RemoteException | ApiException e) { listener.failure(new Vendor.Error(INVENTORY_QUERY_FAILURE, codeFromException(e))); } catch (JSONException e) { listener.failure(new Vendor.Error(INVENTORY_QUERY_MALFORMED_RESPONSE, -1)); } } InAppBillingV3Vendor();  InAppBillingV3Vendor(String publicKey64);  InAppBillingV3Vendor(AbstractInAppBillingV3API api);  InAppBillingV3Vendor(AbstractInAppBillingV3API api, @Nullable String publicKey64); @Override String id(); @Override void initialize(Context context, InitializationListener listener); @Override void dispose(Context context); @Override boolean available(); @Override boolean canPurchase(Product product); @Override void purchase(Activity activity, Product product, String developerPayload,
                       PurchaseListener listener); @Override void consume(Context context, Purchase purchase, ConsumeListener listener); @Override void getInventory(Context context, Collection<String> inappSkus, Collection<String> subSkus,
                           InventoryListener listener); @Override void getProductDetails(Context context, String sku, boolean isSubscription,
                                ProductDetailsListener listener); @Override void setLogger(@Nullable Logger logger); @Override boolean onActivityResult(int requestCode, int resultCode, Intent data); @Override Product getProductFrom(JSONObject json); @Override Purchase getPurchaseFrom(JSONObject json);  }
@Test(expected = IllegalStateException.class) public void getInventoryRequiresInitialization() throws RemoteException { InAppBillingV3Vendor vendor = new InAppBillingV3Vendor(api, null); vendor.getInventory(mock(Context.class), null, null, mock(InventoryListener.class)); }