code: public static String generateMnemonic(byte[] initialEntropy) {
          validateEntropy(initialEntropy);
          final List<String> words = getWords();
  
          int ent = initialEntropy.length * 8;
          int checksumLength = ent / 32;
  
          byte checksum = calculateChecksum(initialEntropy);
          boolean[] bits = convertToBits(initialEntropy, checksum);
  
          int iterations = (ent + checksumLength) / 11;
          StringBuilder mnemonicBuilder = new StringBuilder();
          for (int i = 0; i < iterations; i++) {
              int index = toInt(nextElevenBits(bits, i));
              mnemonicBuilder.append(words.get(index));
  
              boolean notLastIteration = i < iterations - 1;
              if (notLastIteration) {
                  mnemonicBuilder.append(" ");
              }
          }
  
          return mnemonicBuilder.toString();
      }
docs: The mnemonic must encode entropy in a multiple of 32 bits. With more entropy security is
  improved but the sentence length increases. We refer to the initial entropy length as ENT.
  The allowed size of ENT is 128-256 bits.
  
  <h3>Mnemonic generation algorithm</h3>
  Given a randomly generated initial entropy of size ENT, first a checksum is generated by
  taking the first {@code ENT / 32} bits of its SHA256 hash. This checksum is appended to
  the end of the initial entropy. Next, these concatenated bits are split into groups of
  11 bits, each encoding a number from 0-2047, serving as an index into a wordlist. Finally,
  we convert these numbers into words and use the joined words as a mnemonic sentence.
  
  @param initialEntropy The initial entropy to generate mnemonic from
  @return The generated mnemonic
  @throws IllegalArgumentException If the given entropy is invalid
  @throws IllegalStateException If the word list has not been loaded