method to replace the MonomerNotationUnit having the MonomerID with the
new MonomerID

@param monomerNotation
given monomer notation
@param newID
new monomer id
@return MonomerNotationUnit
@throws NotationException
if new id is not valid
540284
public final static MonomerNotationUnit produceMonomerNotationUnitWithOtherID(MonomerNotation monomerNotation,
			String newID) throws NotationException {
		MonomerNotationUnit result = new MonomerNotationUnit(newID, monomerNotation.getType());
		if (monomerNotation.isAnnotationTrue()) {
			result.setAnnotation(monomerNotation.getAnnotation());
		}
		result.setCount(monomerNotation.getCount());
		return result;
	}
444300
public static UniversalIdIntQueueMessage newInstance(Long id, byte[] content) {
        UniversalIdIntQueueMessage msg = newInstance(content);
        msg.setId(id);
        return msg;
    }
963718
public Entity newEntity(QualifiedName id) {
	Entity res = of.createEntity();
	res.setId(id);
	return res;
    }
400727
public static UniversalIdStrMessage newInstance(String id, byte[] content) {
        UniversalIdStrMessage msg = newInstance(content);
        msg.setId(id);
        return msg;
    }
58380
public static boolean validateUniquePolymerIDs(HELM2Notation helm2notation) {
		List<String> listPolymerIDs = helm2notation.getPolymerAndGroupingIDs();
		Map<String, String> uniqueId = new HashMap<String, String>();
		for (String polymerID : listPolymerIDs) {
			uniqueId.put(polymerID, "");
		}
		if (listPolymerIDs.size() > uniqueId.size()) {
			LOG.info("Polymer node IDs are not unique");
			return false;
		}

		return true;
	}
292729
public MessageId newMessageId() {
        /*
         * use random into decimal representation
         */
        try {
            synchronized (random) {
                return new MessageId(String.format("%010d", random.nextInt(Integer.MAX_VALUE), 10));
            }
        } catch (PDUStringException e) {
            throw new RuntimeException("Failed creating message id", e);
        }
    }
955147
private static void section2(List<ConnectionNotation> connections, Map<String, String> mapIds) throws NotationException {

    for (ConnectionNotation connection : connections) {
      HELMEntity first = connection.getSourceId();
      String idFirst = first.getId();

      HELMEntity second = connection.getTargetId();
      String idSecond = second.getId();

      if (mapIds.containsKey(idFirst)) {
        first = new ConnectionNotation(mapIds.get(idFirst)).getSourceId();
      }

      if (mapIds.containsKey(idSecond)) {
        second = new ConnectionNotation(mapIds.get(idSecond)).getSourceId();
      }

      ConnectionNotation newConnection = new ConnectionNotation(first, second, connection.getSourceUnit(), connection.getrGroupSource(), connection.getTargetUnit(), connection.getrGroupTarget(),
          connection.getAnnotation());

      helm2notation.addConnection(newConnection);
    }

  }
775242
public static <T> CheckGroupSelector newCheckGroupSelector(final String id)
	{
		final CheckGroupSelector checkGroupSelector = new CheckGroupSelector(id);
		checkGroupSelector.setOutputMarkupId(true);
		return checkGroupSelector;
	}
1308085
public static Artifact withGroupId(String groupId)
    {

        Artifact artifact = new Artifact();
        artifact.groupId = new RegexParameterizedPatternParser(groupId);
        return artifact;
    }
1209548
public static void replaceUnit(/*String group, String unitName, */ Unit newUnit) {
        String group = newUnit.getGroup().getName(), unitName = newUnit.getName();
        readWriteLock.writeLock().lock();
        try {
            //unitMap
            List<Unit> unitList = unitMap.get(group);
            unitList.removeIf(unitToRemove -> Objects.equals(unitToRemove.getName(), unitName));
            unitList.add(newUnit);

            //searchUnitByClassMap
            Map<Class<? extends Unit>, Unit> tmp = new HashMap<>();
            for (Map.Entry<Class<? extends Unit>, Unit> classUnitEntry : searchUnitByClass.entrySet()) {
                Unit unit = classUnitEntry.getValue();
                if (unit.getGroup().getName().equals(group) && unit.getName().equals(unitName)) {
                    tmp.put(classUnitEntry.getKey(), newUnit);
                    break;
                }
            }
            searchUnitByClass.putAll(tmp);

            //searchUnitMap
            searchUnitMap.put(Unit.fullName(group, unitName), newUnit);
        } finally {
            readWriteLock.writeLock().unlock();
        }
    }
40010
public static Identifier fromUuid(UUID uuid) {
        ByteBuffer buf = ByteBuffer.allocate(16);
        buf.putLong(uuid.getMostSignificantBits());
        buf.putLong(uuid.getLeastSignificantBits());
        return new Identifier(buf.array());
    }
204703
private static boolean hasModification(MonomerNotation monomerNotation) throws NotationException {

		if (monomerNotation instanceof MonomerNotationUnitRNA) {
			if (hasModification((MonomerNotationUnitRNA) monomerNotation)) {
				return true;
			}
		} else if (monomerNotation instanceof MonomerNotationGroup) {
			for (MonomerNotationGroupElement element : ((MonomerNotationGroup) monomerNotation).getListOfElements()) {
				if (hasModification(element.getMonomerNotation())) {
					return true;
				}
			}
		} else if (monomerNotation instanceof MonomerNotationList) {
			for (MonomerNotation element : ((MonomerNotationList) monomerNotation).getListofMonomerUnits()) {
				if (hasModification(element)) {
					return true;
				}
			}
		} else {
			throw new NotationException("Unknown MonomerNotation Type " + monomerNotation.getClass());
		}
		return false;
	}
749670
public static UniversalIdStrQueueMessage newInstance(String id, String content) {
        UniversalIdStrQueueMessage msg = newInstance(content);
        msg.setId(id);
        return msg;
    }
91019
public static Repository newInstance(String uid)
    {
        Repository repository = new Repository();
        repository.setUid(uid);
        return repository;
    }
567670
public static <T> Id<T> newId(final TypeToken<T> type) {
        return (Id<T>) Ids.newId(type.getType());
    }
31033
public MessageEventDefinitionBuilder messageEventDefinition(String id) {
    MessageEventDefinition messageEventDefinition = createEmptyMessageEventDefinition();
    if (id != null) {
      messageEventDefinition.setId(id);
    }

    element.getEventDefinitions().add(messageEventDefinition);
    return new MessageEventDefinitionBuilder(modelInstance, messageEventDefinition);
  }
762716
@Override @DefinedBy(Api.COMPILER_TREE)
    public DCDocComment newDocCommentTree(List<? extends DocTree> fullBody, List<? extends DocTree> tags) {
        ListBuffer<DCTree> lb = new ListBuffer<>();
        lb.addAll(cast(fullBody));
        List<DCTree> fBody = lb.toList();

        // A dummy comment to keep the diagnostics logic happy.
        Comment c = new Comment() {
            @Override
            public String getText() {
                return null;
            }

            @Override
            public int getSourcePos(int index) {
                return Position.NOPOS;
            }

            @Override
            public CommentStyle getStyle() {
                return CommentStyle.JAVADOC;
            }

            @Override
            public boolean isDeprecated() {
                return false;
            }
        };
        Pair<List<DCTree>, List<DCTree>> pair = splitBody(fullBody);
        DCDocComment tree = new DCDocComment(c, fBody, pair.fst, pair.snd, cast(tags));
        return tree;
    }