code: public static void checkValid(Money value) {
      String currencyCode = value.getCurrencyCode();
      if (currencyCode == null || currencyCode.length() != 3) {
        throw new IllegalArgumentException(MSG_3_LETTERS_LONG);
      }
      long units = value.getUnits();
      int nanos = value.getNanos();
      if ((units > 0 && nanos < 0) || (units < 0 && nanos > 0)) {
        throw new IllegalArgumentException(MSG_UNITS_NANOS_MISMATCH);
      }
      if (Math.abs(nanos) > MAX_NANOS) {
        throw new IllegalArgumentException(MSG_NANOS_OOB);
      }
    }
docs: Determine if an instance of {@code Money} is valid.
  
  @param value an instance of {@code Money}
  @throws java.lang.IllegalArgumentException if money is invalid