Lazy creation of properties hash. I should
integrate into ChemObject.

@return    Returns in instance of the properties
555258
private Map<Object, Object> lazyProperties() {
        if (properties == null) {
            properties = new Hashtable<Object, Object>();
        }
        return properties;
    }
725201
def to_hash
      {}.merge(@properties).tap do |h|
        h['_links'] = {}.merge @links    unless @links.empty?

        combined_embedded = {}
        combined_embedded.merge! @embedded unless @embedded.empty?
        combined_embedded.merge! @embedded_arrays unless @embedded_arrays.empty?
        h['_embedded'] = combined_embedded unless combined_embedded.empty?
      end
    end
1089768
public FacesConfigPropertyType<FacesConfigConverterType<T>> getOrCreateProperty()
   {
      List<Node> nodeList = childNode.get("property");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FacesConfigPropertyTypeImpl<FacesConfigConverterType<T>>(this, "property", childNode, nodeList.get(0));
      }
      return createProperty();
   }
1073467
protected Map<PropertyKey, Object> properties() {

        if (properties == null) {
            properties = new EnumMap<>(PropertyKey.class);
        }

        return properties;
    }
25332
public GroovyFieldDoc[] properties() {
        Collections.sort(properties);
        return properties.toArray(new GroovyFieldDoc[properties.size()]);
    }
1046418
public MethodKey createCopy() {
        int size = getParameterCount();
        Class[] paramTypes = new Class[size];
        for (int i = 0; i < size; i++) {
            paramTypes[i] = getParameterType(i);
        }
        return new DefaultMethodKey(sender, name, paramTypes, isCallToSuper);
    }
1177454
public Property build() {
        if (null == type) {
            throw new IllegalStateException("type is required");
        }
        if (null == name) {
            throw new IllegalStateException("name is required");
        }
        return PropertyUtil.forType(
                type,
                name,
                title,
                description,
                required,
                value,
                values,
                labels,
                validator,
                scope,
                renderingOptions,
                dynamicValues
        );
    }
288724
public synchronized Object[] getIds() {
        String[] keys = getAllKeys();
        int size = keys.length + indexedProps.size();
        Object[] res = new Object[size];
        System.arraycopy(keys, 0, res, 0, keys.length);
        int i = keys.length;
        // now add all indexed properties
        for (Object index : indexedProps.keySet()) {
            res[i++] = index;
        }
        return res;
    }
784793
protected static List<PropertyDescriptor> getWriteableProperties(Class cls)
        {
        BeanWrapper beanWrapper = new BeanWrapperImpl(cls);
        List<PropertyDescriptor> writeableProperties =
                new ArrayList<PropertyDescriptor>();
        PropertyDescriptor[] props = beanWrapper.getPropertyDescriptors();
        for (PropertyDescriptor prop : props)
            {
            if (isWriteable(prop))
                {
                writeableProperties.add(prop);
                }
            }
        return writeableProperties;
        }
158448
def serializable_hash(*)
      h               = attributes.extract!('included')
      h['data']       = { 'type'       => self.class.to_s.underscore.sub('esp/', '').pluralize,
                          'attributes' => changed_attributes.except('id', 'type', 'created_at', 'updated_at', 'relationships') }
      h['data']['id'] = id if id.present?
      h
    end
732541
@Override
    public Serializable generateKey(final MethodInvocation methodInvocation) {
        //Determine the tareted CachableMethod
        final CachableMethod cachableMethod = this.resolveCacheableMethod(methodInvocation);

        //Use the resolved cachableMethod to determine the seed Map and then get the hash of the key elements
        final Object[] methodArguments = methodInvocation.getArguments();
        final Map<String, Object> seed = this.getSeed(methodArguments, cachableMethod);
        final Integer keyHashCode = this.getKeyHash(seed);

        //If no code generated return null
        if (keyHashCode == null) {
            if (this.logger.isDebugEnabled()) {
                this.logger.debug("No cache key generated for MethodInvocation='" + methodInvocation + "'");
            }
            return null;
        }

        //Calculate the hashCode and checkSum
        final HashCodeCalculator hashCodeCalculator = new HashCodeCalculator();
        hashCodeCalculator.append(keyHashCode);

        //Assemble the serializable key object
        final long checkSum = hashCodeCalculator.getCheckSum();
        final int hashCode = hashCodeCalculator.getHashCode();
        final HashCodeCacheKey hashCodeCacheKey = new HashCodeCacheKey(checkSum, hashCode);

        if (this.logger.isDebugEnabled()) {
            this.logger.debug("Generated cache key '" + hashCodeCacheKey + "' for MethodInvocation='" + methodInvocation + "'");
        }
        return hashCodeCacheKey;
    }
479418
def to_hash
      hash = {}
      instance_variables.each do |name|
        value = instance_variable_get(name)
        next if value.nil?
        name = name[1..-1]
        key = self.class.names.key?(name) ? self.class.names[name] : name
        if value.instance_of? Array
          hash[key] = value.map { |v| v.is_a?(BaseModel) ? v.to_hash : v }
        elsif value.instance_of? Hash
          hash[key] = {}
          value.each do |k, v|
            hash[key][k] = v.is_a?(BaseModel) ? v.to_hash : v
          end
        else
          hash[key] = value.is_a?(BaseModel) ? value.to_hash : value
        end
      end
      hash
    end
707063
public Property<Properties<T>> getOrCreateProperty()
   {
      List<Node> nodeList = childNode.get("property");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new PropertyImpl<Properties<T>>(this, "property", childNode, nodeList.get(0));
      }
      return createProperty();
   }
624695
public Map<Object, Object> getPropertyBag() {
        if (this.properties == null) {
            this.properties = new HashMap<Object, Object>();
        }
        return this.properties;
    }
611610
public ArrayList getProperties(){
		ArrayList properties = new ArrayList();
		if (configEntry.properties != null){
			Iterator it = configEntry.properties.values().iterator();
			while (it.hasNext()){
				Property property = new Property((com.ibm.ws.cache.config.Property)it.next());
				properties.add(property);
			}
		}
		return properties;
	}
1288759
def currentpropvalues
    # It's important to use the 'properties' method here, as it follows the order
    # in which they're defined in the class.  It also guarantees that 'ensure'
    # is the first property, which is important for skipping 'retrieve' on
    # all the properties if the resource is absent.
    ensure_state = false
    return properties.inject({}) do | prophash, property|
      if property.name == :ensure
        ensure_state = property.retrieve
        prophash[property] = ensure_state
      else
        if ensure_state == :absent
          prophash[property] = :absent
        else
          prophash[property] = property.retrieve
        end
      end
      prophash
    end
  end
1297438
public Map<String, Object> build() {
        final ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder();
        final int keyCode = ofNullable(this.keyCode)
                .orElseThrow(() -> new IllegalStateException("The key code must be set"));
        builder.put("keycode", keyCode);
        ofNullable(this.metaState).ifPresent(x -> builder.put("metastate", x));
        ofNullable(this.flags).ifPresent(x -> builder.put("flags", x));
        return builder.build();
    }