### Question:
Billing { @Nonnull public BillingRequests getRequests() { return mRequests; } Billing(@Nonnull Context context, @Nonnull Configuration configuration);  Billing(@Nonnull Context context, @Nonnull Handler handler, @Nonnull Configuration configuration); static void setLogger(@Nullable Logger logger); @Nonnull static Cache newCache(); @Nonnull static PurchaseVerifier newPurchaseVerifier(@Nonnull String publicKey); @Nonnull static Logger newLogger(); @Nonnull static Logger newMainThreadLogger(@Nonnull Logger logger); @Nonnull Context getContext(); void connect(); void addPlayStoreListener(@Nonnull PlayStoreListener listener); void removePlayStoreListener(@Nonnull PlayStoreListener listener); void disconnect(); void cancel(int requestId); void cancelAll(); @Nonnull RequestsBuilder newRequestsBuilder(); @Nonnull BillingRequests getRequests(); @Nonnull Requests getRequests(@Nullable Object tag); void onCheckoutStarted();  }### Answer:
@Test public void testShouldLoadAllPurchases() throws Exception { final Billing billing = prepareMultiPurchasesBilling(); final CountDownLatch latch = new CountDownLatch(1); final CountDownListener l = new CountDownListener(latch); billing.getRequests().getAllPurchases(ProductTypes.IN_APP, l); assertTrue(latch.await(1, SECONDS)); verify(l.listener).onSuccess(argThat(new PurchasesMatcher())); }
@Test public void testShouldLoadWholePurchaseHistory() throws Exception { final Billing billing = prepareMultiPurchasesBilling(); final CountDownLatch latch = new CountDownLatch(1); final CountDownListener l = new CountDownListener(latch); billing.getRequests().getWholePurchaseHistory(ProductTypes.IN_APP, null, l); assertTrue(latch.await(1, SECONDS)); verify(l.listener).onSuccess(argThat(new PurchasesMatcher())); }