### Question:
CartManager { @NonNull public String getCurrencyCode() { return mCurrency.getCurrencyCode(); } CartManager();  CartManager(String currencyCode);  CartManager(@NonNull Cart oldCart);  CartManager(@NonNull Cart oldCart, boolean shouldKeepShipping, boolean shouldKeepTax); @Nullable String addLineItem(@NonNull @Size(min = 1) String description, long totalPrice); @Nullable String addLineItem(@NonNull @Size(min = 1) String description,
                              double quantity,
                              long unitPrice); @Nullable String addShippingLineItem(@NonNull @Size(min = 1) String description, long totalPrice); @Nullable String addShippingLineItem(@NonNull @Size(min = 1) String description,
                                      double quantity,
                                      long unitPrice); @Nullable Long calculateRegularItemTotal(); @Nullable Long calculateShippingItemTotal(); Long calculateTax(); void setTaxLineItem(@NonNull @Size(min = 1) String description, long totalPrice); void setTotalPrice(@Nullable Long totalPrice); void setTaxLineItem(@Nullable LineItem item); @Nullable LineItem removeLineItem(@NonNull @Size(min = 1) String itemId); @Nullable String addLineItem(@NonNull LineItem item); @NonNull Cart buildCart(); @Nullable Long getTotalPrice(); @NonNull Currency getCurrency(); @NonNull String getCurrencyCode(); @NonNull LinkedHashMap<String, LineItem> getLineItemsRegular(); @NonNull LinkedHashMap<String, LineItem> getLineItemsShipping(); @Nullable LineItem getLineItemTax();  }### Answer:
@Test public void createCartManager_withoutCurrencyArgument_usesAndroidPayConfiguration() { AndroidPayConfiguration.getInstance().setCurrencyCode("JPY"); CartManager cartManager = new CartManager(); assertEquals("JPY", cartManager.getCurrencyCode()); }
@Test public void createCartManager_withCurrencyDifferentFromConfiguration_changesConfigAndLogs() { ShadowLog.stream = System.out; AndroidPayConfiguration.getInstance().setCurrencyCode("KRW"); String expectedWarning = "Cart created with currency code GBP, which differs from " + "current AndroidPayConfiguration currency, KRW. Changing configuration to GBP"; new CartManager("GBP"); assertEquals("GBP", AndroidPayConfiguration.getInstance().getCurrencyCode()); List<ShadowLog.LogItem> logItems = ShadowLog.getLogsForTag(CartManager.TAG); assertFalse(logItems.isEmpty()); assertEquals(1, logItems.size()); assertEquals(expectedWarning, logItems.get(0).msg); assertEquals(Log.WARN, logItems.get(0).type); }