code: public void checkNameUniqueness(String name) {
  		if (usedNames.contains(name)) {
  			throw new MalformedPatternException("Duplicate pattern name: " + name + ". Names must be unique.");
  		}
  		usedNames.add(name);
  	}
docs: Checks if the given name is already used or not. If yes, it
  throws a {@link MalformedPatternException}.
  
  @param name The name to be checked.