src/main/java/org/helm/notation2/parser/StateMachineParser.java
public boolean isPeptideOrRna() throws SimplePolymerSectionException {
    if (polymerElements.size() >= 1) {
      if (polymerElements.get(polymerElements.size() - 1).matches("(PEPTIDE[1-9][0-9]*+|RNA[1-9][0-9]*)")) {
        return true;
      }
      return false;
    } else {
      throw new SimplePolymerSectionException("No Polymer Id is found");
    }
  }
public boolean isPeptideOrRna() throws SimplePolymerSectionException {
    if (polymerElements.size() >= 1) {
      if (polymerElements.get(polymerElements.size() - 1).matches("(PEPTIDE[1-9][0-9]*+|RNA[1-9][0-9]*)")) {
        return true;
      }
      return false;
    } else {
      throw new SimplePolymerSectionException("No Polymer Id is found");
    }
  }
method to check if the last added polymer element is a peptide or a rna

@return true, if the last added polymer is a peptide or a rna, false
otherwise
@throws SimplePolymerSectionException if list of polymers is null