code: private void setExchangeRateChain(List<ExchangeRate> chain) {
          this.chain.clear();
          if (chain==null || chain.isEmpty()) {
              this.chain.add(this);
          } else {
              for (ExchangeRate rate : chain) {
                  if (rate==null) {
                      throw new IllegalArgumentException("Rate Chain element can not be null.");
                  }
              }
              this.chain.addAll(chain);
          }
      }
docs: Internal method to set the rate chain, which also ensure that the chain
  passed, when not null, contains valid elements.
  
  @param chain the chain to set.