code: public static void shiftIndelsAtHomopolymers(Sequence seq1, int seq1From, int[] mutations) {
          int prevPos = seq1From;
  
          for (int i = 0; i < mutations.length; i++) {
              int code = mutations[i];
              if (!isSubstitution(code)) {
                  int pos = getPosition(code), offset = 0;
                  if (pos < seq1From)
                      throw new IllegalArgumentException();
                  int nt = isDeletion(code) ? getFrom(code) : getTo(code);
                  while (pos > prevPos && seq1.codeAt(pos - 1) == nt) {
                      pos--;
                      offset--;
                  }
                  mutations[i] = move(code, offset);
                  prevPos = getPosition(mutations[i]);
                  if (isDeletion(mutations[i]))
                      prevPos++;
              } else {
                  prevPos = getPosition(mutations[i]) + 1;
              }
          }
      }
docs: This one shifts indels to the left at homopolymer regions Applicable to KAligner data, which normally put indels
  randomly along such regions Required for filterMutations algorithm to work correctly Works inplace
  
  @param seq1      reference sequence for the mutations
  @param seq1From  seq1 from
  @param mutations array of mutations