### Question:
PaymentUtils { public static boolean matchesCurrencyPatternOrEmpty(@Nullable String priceString) { if (TextUtils.isEmpty(priceString)) { return true; } Pattern pattern = Pattern.compile("^-?[0-9]+(\\.[0-9][0-9])?"); return pattern.matcher(priceString).matches(); }  static boolean matchesCurrencyPatternOrEmpty(@Nullable String priceString); static boolean matchesQuantityPatternOrEmpty(@Nullable String quantityString); @NonNull static List<CartError> validateLineItemList(
            List<LineItem> lineItems,
            @NonNull String currencyCode); static CartError searchLineItemForErrors(LineItem lineItem); @NonNull static String getPriceString(long price); @NonNull static List<CartError> removeErrorType(
            @NonNull List<CartError> errors,
            @NonNull @CartError.CartErrorType String errorType); @NonNull static String getPriceString(Long price, @NonNull Currency currency); static IsReadyToPayRequest getStripeIsReadyToPayRequest();  }### Answer:
@Test public void matchesCurrencyPattern_whenValid_returnsTrue() { assertTrue(matchesCurrencyPatternOrEmpty(null)); assertTrue(matchesCurrencyPatternOrEmpty("")); assertTrue(matchesCurrencyPatternOrEmpty("10.00")); assertTrue(matchesCurrencyPatternOrEmpty("01.11")); assertTrue(matchesCurrencyPatternOrEmpty("5000.05")); assertTrue(matchesCurrencyPatternOrEmpty("100")); assertTrue(matchesCurrencyPatternOrEmpty("-5")); }
@Test public void matchesCurrencyPattern_whenInvalid_returnsFalse() { assertFalse(matchesCurrencyPatternOrEmpty(".99")); assertFalse(matchesCurrencyPatternOrEmpty("0.123")); assertFalse(matchesCurrencyPatternOrEmpty("1.")); }