code: public static void getNestedConcats(StringBuilder stb, ImmutableTerm term1, ImmutableTerm term2) {
          if (term1 instanceof ImmutableFunctionalTerm) {
              ImmutableFunctionalTerm f = (ImmutableFunctionalTerm) term1;
              getNestedConcats(stb, f.getTerms().get(0), f.getTerms().get(1));
          } else {
              stb.append(appendTerms(term1));
          }
          if (term2 instanceof ImmutableFunctionalTerm) {
              ImmutableFunctionalTerm f = (ImmutableFunctionalTerm) term2;
              getNestedConcats(stb, f.getTerms().get(0), f.getTerms().get(1));
          } else {
              stb.append(appendTerms(term2));
          }
      }
docs: Appends nested concats