code: @Nonnull
      public String getCode(final int precision, @Nullable final Alphabet alphabet) {
          if (precision == 0) {
              return convertStringToAlphabet(codePrecision8.substring(0, codePrecision8.length() - 9), alphabet);
          } else if (precision <= 8) {
              return convertStringToAlphabet(codePrecision8.substring(0, (codePrecision8.length() - 8) + precision),
                      alphabet);
          } else {
              throw new IllegalArgumentException("getCodePrecision: precision must be in [0, 8]");
          }
      }
docs: Get the mapcode code (without territory information) with a specified precision.
  The returned mapcode includes a '-' separator and additional digits for precisions 1 to 8.
  
  The precision defines the size of a geographical area a single mapcode covers. This means It also defines
  the maximum distance to the location, a (latitude, longitude) pair, that encoded to this mapcode.
  
  Precision 0: area is approx 10 x 10 meters (100 m2); max. distance from original location less than 7.5 meters.
  Precision 1: area is approx 3.33 m2; max. distance from original location less than 1.5 meters.
  Precision 1: area is approx 0.11 m2; max. distance from original location less than 0.4 meters.
  etc. (each level reduces the area by a factor of 30)
  
  The accuracy is slightly better than the figures above, but these figures are safe assumptions.
  
  @param precision Precision. Range: 0..8.
  @param alphabet  Alphabet.
  @return Mapcode code.
  @throws IllegalArgumentException Thrown if precision is out of range (must be in [0, 8]).