code: public static String getSequence(PolymerNotation polymer) throws HELM2HandledException, PeptideUtilsException, ChemistryException{
      checkPeptidePolymer(polymer);
      StringBuilder sb = new StringBuilder();
      List<Monomer> monomers = MethodsMonomerUtils.getListOfHandledMonomers(polymer.getListMonomers());
  
      for (Monomer monomer : monomers) {
        String id = monomer.getAlternateId();
        if (id.length() > 1) {
          id = "[" + id + "]";
        }
        sb.append(id);
      }
      return sb.toString();
    }
docs: method to produce for a peptide PolymerNotation the sequence
  
  @param polymer PolymerNotation
  @return sequence
  @throws HELM2HandledException if the polmyer contains HELM2 features
  @throws PeptideUtilsException is not a peptide
  @throws ChemistryException if the Chemistry Engine is not initialized