docs: @Pure
  	protected Attribute getStoredAttribute(String name, AttributeType expectedType) {
  		Object val = this.heap.get(name);
  		if (val != null) {
  			final AttributeType currentType = AttributeType.fromValue(val);
  			val = unprotectNull(val);
  			final Attribute attr = new AttributeImpl(name);
  			if (expectedType == null) {
  				attr.castAndSet(currentType, val);
  			} else {
  				attr.castAndSet(expectedType, val);
  			}
  			return attr;
  		}
  		return null;
  	}