code: private static Map<String, String> findAdHocMonomers(String elements, String type) throws HELM1FormatException, ValidationException, ChemistryException,
        org.helm.notation2.parser.exceptionparser.NotationException {
      /* find adHocMonomers */
      try {
        Map<String, String> listMatches = new HashMap<String, String>();
        String[] listelements = elements.split("\\.");
        if (type == "RNA") {
          for (String element : listelements) {
            List<String> monomerIds;
            monomerIds = NucleotideParser.getMonomerIDListFromNucleotide(element);
  
            for (String id : monomerIds) {
  
              Monomer monomer = MonomerFactory.getInstance().getMonomerStore().getMonomer(type, id);
              if (monomer.isAdHocMonomer()) {
                listMatches.put(element, "[" + monomer.getCanSMILES() + "]");
  
              }
            }
          }
  
        } else {
          for (String element : listelements) {
            Monomer monomer = MonomerFactory.getInstance().getMonomerStore().getMonomer(type, element.replace("[", "").replace("]", ""));
            try {
              if (monomer.isAdHocMonomer()) {
                listMatches.put(element, "[" + monomer.getCanSMILES() + "]");
              }
            } catch (NullPointerException e) {
              if (!(Chemistry.getInstance().getManipulator().validateSMILES(element.substring(1, element.length() - 1)))) {
                e.printStackTrace();
                throw new ValidationException("SMILES as Monomer is not valid :" + element);
              }
            }
          }
        }
  
        return listMatches;
      } catch (MonomerLoadingException e) {
        e.printStackTrace();
        throw new HELM1FormatException(e.getMessage());
      }
    }
docs: /*
  method has to be changed !!! including smiles -> to generate canonical
  representation; this method has to be tested in further detail