/** * Returns the TariffSubscription for the given Tariff/Customer pair, creating * it if necessary. Note that as of issue #505, you can get null back if you * try to get a subscription for a non-existent tariff, such as one that has * been revoked. */ public TariffSubscription getSubscription (CustomerInfo customer, Tariff tariff) { TariffSubscription result = findSubscriptionForCustomer(tariffMap.get(tariff), customer); if (null != result) { // subscription exists return result; } result = new TariffSubscription(customer, tariff); storeSubscription(result, customer, tariff); return result; }