/**
  * Initializes the helper to prepare it for the next changing process. All private fields get new
  * values, old ones are discarded. This also initializes <code>AttributeHandler</code>.
  *
  * @param seed the seed value used to generate random values
  * @param ignoreExceptions should exceptions be ignored and logged?
  * @see AttributeHandler#setRandom(Random)
  */
 protected static void init(long seed, boolean ignoreExceptions) {
   random = new Random(seed);
   amountOfWork = 0;
   ignoreAndLog = ignoreExceptions;
   exceptionLog = new LinkedHashSet<RuntimeException>();
   AttributeHandler.setRandom(random);
 }
  /**
   * Sets all possible attributes of known types to random values using {@link IAttributeSetter} and
   * SetCommands/AddCommands.
   *
   * @param eObject the EObject to set attributes for
   * @param random the Random object used to determine the creation of attributes
   * @param exceptionLog the current log of exceptions
   * @param ignoreAndLog should exceptions be ignored and added to <code>exceptionLog</code>?
   * @see IAttributeSetter
   * @see AttributeHandler
   * @see #addPerCommand(EObject, EStructuralFeature, Collection, Set, boolean)
   * @see #addPerCommand(EObject, EStructuralFeature, Object, Set, boolean)
   * @see #setPerCommand(EObject, EStructuralFeature, Object, Set, boolean)
   */
  public static void setEObjectAttributes(
      EObject eObject, Random random, Set<RuntimeException> exceptionLog, boolean ignoreAndLog) {
    Map<EClassifier, IAttributeSetter<?>> attributeSetters = AttributeHandler.getAttributeSetters();

    for (EAttribute attribute : eObject.eClass().getEAllAttributes()) {
      EClassifier attributeType = attribute.getEAttributeType();

      if (!isValid(attribute, eObject, exceptionLog, ignoreAndLog)) {
        continue;
      }

      // the attribute setter used to create new attributes
      IAttributeSetter<?> attributeSetter = null;

      // is there a setter for this attribute?
      if (attributeSetters.containsKey(attributeType)) {
        attributeSetter = attributeSetters.get(attributeType);
      } else if (isEnum(attributeType)) {
        attributeSetter = AttributeHandler.getEEnumSetter((EEnum) attributeType);
      }

      // was there a fitting attribute setter?
      if (attributeSetter != null) {
        if (attribute.isMany()) {
          int numberOfAttributes = computeFeatureAmount(attribute, random);
          addPerCommand(
              eObject,
              attribute,
              attributeSetter.createNewAttributes(numberOfAttributes),
              exceptionLog,
              ignoreAndLog);
        } else {
          setPerCommand(
              eObject, attribute, attributeSetter.createNewAttribute(), exceptionLog, ignoreAndLog);
        }
      }
    }
  }