Customer customer = Customer.create(defaultCustomerParams);
// Create
Map<String, Object> subCreateParams = new HashMap<String, Object>();
subCreateParams.put("plan", plan.getId());
Subscription sub = customer.createSubscription(subCreateParams);
assertEquals(plan.getId(), sub.getPlan().getId());
customer = Customer.retrieve(customer.getId());
assertEquals(1, customer.getSubscriptions().getData().size());
assertEquals(sub.getId(), customer.getSubscriptions().getData().get(0).getId());
// Retrieve
Subscription retrievedSub = customer.getSubscriptions().retrieve(sub.getId());
assertEquals(sub.getId(), retrievedSub.getId());
// List
CustomerSubscriptionCollection list = customer.getSubscriptions().all(null);
assertEquals(1, list.getData().size());
assertEquals(sub.getId(), list.getData().get(0).getId());