docs: private StringBuilder adjustBinaryString(String binaryString, boolean compact, int layers) {
  
          StringBuilder adjustedString = new StringBuilder();
          int codewordSize = getCodewordSize(layers);
  
          for (int i = 0, j = 0; i < binaryString.length(); ) {
              if (((j + 1) % codewordSize) == 0) {
                  /* Last bit of codeword */
                  boolean done = false;
                  int ones = 0;
                  for (int t = 0; t < (codewordSize - 1); t++) {
                      if (binaryString.charAt((i - (codewordSize - 1)) + t) == '1') {
                          ones++;
                      }
                  }
                  if (ones == (codewordSize - 1)) {
                      adjustedString.append('0');
                      j++;
                      done = true;
                  }
                  if (ones == 0) {
                      adjustedString.append('1');
                      j++;
                      done = true;
                  }
                  if (!done) {
                      adjustedString.append(binaryString.charAt(i));
                      j++;
                      i++;
                  }
              } else {
                  adjustedString.append(binaryString.charAt(i));
                  j++;
                  i++;
              }
          }
  
          int adjustedLength = adjustedString.length();
          int remainder = adjustedLength % codewordSize;
  
          /* Add padding */
          int padBits = codewordSize - remainder;
          if (padBits == codewordSize) {
              padBits = 0;
          }
          for (int i = 0; i < padBits; i++) {
              adjustedString.append('1');
          }
          adjustedLength = adjustedString.length();
  
          /* Make sure padding didn't create an invalid (all 1s) codeword */
          int count = 0;
          for (int i = Math.max(adjustedLength - codewordSize, 0); i < adjustedLength; i++) {
              if (adjustedString.charAt(i) == '1') {
                  count++;
              }
          }
          if (count == codewordSize) {
              adjustedString.setCharAt(adjustedLength - 1, '0');
          }
  
          /* Check if the data actually fits into the selected symbol size */
          int dataMaxSize;
          if (compact) {
              dataMaxSize = codewordSize * (AZTEC_COMPACT_SIZES[layers - 1] - 3);
          } else {
              dataMaxSize = codewordSize * (AZTEC_SIZES[layers - 1] - 3);
          }
  
          if (adjustedLength > dataMaxSize) {
              throw new OkapiException("Data too long for specified Aztec Code symbol size");
          }
  
          /* Log the codewords */
          encodeInfo += "Codewords: ";
          for (int i = 0; i < (adjustedLength / codewordSize); i++) {
              int l = 0, m = (1 << (codewordSize - 1));
              for (int j = 0; j < codewordSize; j++) {
                  if (adjustedString.charAt((i * codewordSize) + j) == '1') {
                      l += m;
                  }
                  m = m >> 1;
              }
              encodeInfo += Integer.toString(l) + " ";
          }
          encodeInfo += "\n";
  
          /* Return the adjusted bit string */
          return adjustedString;
      }