code: public static boolean check(int[] mutations) {
          for (int i = 0; i < mutations.length; ++i) {
              if (i > 0) {
                  if (isDeletion(mutations[i - 1]) && isInsertion(mutations[i]) &&
                          getPosition(mutations[i - 1]) == getPosition(mutations[i]) - 1)
                      return false;
                  if (isDeletion(mutations[i]) && isInsertion(mutations[i - 1]) &&
                          getPosition(mutations[i - 1]) == getPosition(mutations[i]))
                      return false;
              }
              if (isSubstitution(mutations[i]) && getFrom(mutations[i]) == getTo(mutations[i]))
                  return false;
          }
          return true;
      }
docs: TODO add more checks