code: public static boolean areElementEquals(Element element1, Element element2) {
  		for (Mask mask1 : element1.getMask()) {
  			if (!areBooleanEquals(element1.isNegated(), element2.isNegated())) {
  				// Negated.
  				return false;
  			}
  			for (Mask mask2 : element2.getMask()) {
  				if (!areStringEquals(mask1.getLexemeMask(), mask2.getLexemeMask())) {
  					// LexemeMask.
  					return false;
  				} else if (!areStringEquals(mask1.getPrimitiveMask(), mask2.getPrimitiveMask())) {
  					// PrimitiveMask.
  					return false;
  				} else if (!areTagMaskEquals(mask1.getTagMask(), mask2.getTagMask())) {
  					// TagMask.
  					return false;
  				}
  			}
  		}
  		return true;
  	}
docs: Checks if two elements are equals.
  
  @param element1 from tree element {@link Element}
  @param element2 from rule element {@link Element}
  @return true if the elements are equal, false otherwise