code: @Override
      public void parse(ParseContext context)
              throws MonetaryParseException {
          String token = context.lookupNextToken();
          while (token!=null) {
              if (!token.trim().isEmpty()) {
                  break;
              }
              context.consume(token);
              token = context.lookupNextToken();
          }
          if(token==null){
              throw new MonetaryException("Error parsing CurrencyUnit: token expected");
          }
          try {
              CurrencyUnit cur;
              switch (style) {
                  case CODE:
                      if (!Monetary.isCurrencyAvailable(token)) {
                          // Perhaps blank is missing between currency code and number...
                          String subCurrency = parseCurrencyCode(token);
                          cur = Monetary.getCurrency(subCurrency);
                          context.consume(subCurrency);
                      } else {
                          cur = Monetary.getCurrency(token);
                          context.consume(token);
                      }
                      break;
                  case SYMBOL:
                      if (token.startsWith("$")) {
                          throw new MonetaryParseException("$ is not a unique currency symbol.", token,
                                  context.getErrorIndex());
                      } else if (token.startsWith("€")) {
                          cur = Monetary.getCurrency("EUR");
                          context.consume("€");
                      } else if (token.startsWith("£")) {
                          cur = Monetary.getCurrency("GBP");
                          context.consume("£");
                      } else {
                          cur = Monetary.getCurrency(token);
                          context.consume(token);
                      }
                      context.setParsedCurrency(cur);
                      break;
                  case NAME:
                  case NUMERIC_CODE:
                  default:
                      throw new UnsupportedOperationException("Not yet implemented");
              }
              if (cur!=null) {
                  context.setParsedCurrency(cur);
              }
          } catch (Exception e) {
              throw new MonetaryException("Error parsing CurrencyUnit.", e);
          }
      }
docs: Parses a currency from the given {@link ParseContext}. Depending on the
  current {@link CurrencyStyle} it interprets the next non empty token,
  either as
  <ul>
  <li>currency code
  <li>currency symbol
  </ul>
  Parsing of localized currency names or numeric code is not supported.
  
  @throws UnsupportedOperationException if the {@link CurrencyStyle} is configured to us currency
  names, or numeric codes for formatting.