code: public void checkValid() {
          final StringBuilder b = new StringBuilder();
          if (precisionForFxRate < 2) {
              b.append("Precision for FX should be >=2");
          }
          if (precisionForInverseFxRate < 2) {
              if (b.length() > 0) {
                  b.append(",");
              }
              b.append("Precision for 1/FX should be >=2");
          }
          if (ratesSnapshot.isEmpty() && baseFxRateProvider == null) {
              if (b.length() > 0) {
                  b.append(",");
              }
              b.append("You must provide Base Rates Snapshots OR a BaseFxRateProvider");
          }
  
          if (b.length() > 0) {
              throw new IllegalArgumentException(b.toString());
          }
      }
docs: Check if the builder is valid i.e.
  * precisions greater than 1
  * ratesSnapshot not empty or a BaseFxRateProvider was provided
  @throws IllegalArgumentException if the validation fails.