class DefaultInAppPurchaseConsumer implements InAppPurchaseConsumer<ManagedProduct> {

    @Override
    public boolean isConsumed(@NonNull ManagedProduct managedProduct, @NonNull PurchaseFamily purchaseFamily) {
        if (managedProduct instanceof ConsumablePurchase) {
            return consumableInAppPurchaseConsumer.isConsumed((ConsumablePurchase)managedProduct, purchaseFamily);
        } else if (managedProduct instanceof Subscription) {
            return subscriptionInAppPurchaseConsumer.isConsumed((Subscription)managedProduct, purchaseFamily);
        } else {
            throw new IllegalArgumentException("Unsupported managed product type: " + managedProduct);
        }
    }

    @Inject public  DefaultInAppPurchaseConsumer(@NonNull ConsumableInAppPurchaseConsumer consumableInAppPurchaseConsumer,
                                        @NonNull SubscriptionInAppPurchaseConsumer subscriptionInAppPurchaseConsumer);

}