text:
package org.openestate.io.kyero.xml;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.jvnet.jaxb2_commons.lang.CopyStrategy2;
import org.jvnet.jaxb2_commons.lang.CopyTo2;
import org.jvnet.jaxb2_commons.lang.Equals2;
import org.jvnet.jaxb2_commons.lang.EqualsStrategy2;
import org.jvnet.jaxb2_commons.lang.JAXBCopyStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
import org.jvnet.jaxb2_commons.lang.ToString2;
import org.jvnet.jaxb2_commons.lang.ToStringStrategy2;
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;

/**
 *
Java class for anonymous complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType>
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="kyero" type="{}kyeroType"/>
 *         <element name="agent" minOccurs="0">
 *           <complexType>
 *             <complexContent>
 *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *                 <all>
 *                   <element name="id" type="{http://www.w3.org/2001/XMLSchema}integer" minOccurs="0"/>
 *                   <element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *                   <element name="email" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *                   <element name="tel" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *                   <element name="fax" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *                   <element name="mob" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *                   <element name="addr1" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *                   <element name="addr2" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *                   <element name="town" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *                   <element name="region" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *                   <element name="postcode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *                   <element name="country" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *                 </all>
 *               </restriction>
 *             </complexContent>
 *           </complexType>
 *         </element>
 *         <element name="property" type="{}propertyType" maxOccurs="unbounded"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "kyero",
    "agent",
    "property"
})
@XmlRootElement(name = "root")
@Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
public class Root implements Serializable, Cloneable, CopyTo2, Equals2, ToString2
{

    @XmlElement(required = true)
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
    protected KyeroType kyero;
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
    protected Root.Agent agent;
    @XmlElement(required = true)
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
    protected List<PropertyType> property;

    /**
     * Gets the value of the kyero property.
     *
     * @return
     *     possible object is
     *     {@link KyeroType }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
    public KyeroType getKyero() {
        return kyero;
    }

    /**
     * Sets the value of the kyero property.
     *
     * @param value
     *     allowed object is
     *     {@link KyeroType }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
    public void setKyero(KyeroType value) {
        this.kyero = value;
    }

    /**
     * Gets the value of the agent property.
     *
     * @return
     *     possible object is
     *     {@link Root.Agent }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
    public Root.Agent getAgent() {
        return agent;
    }

    /**
     * Sets the value of the agent property.
     *
     * @param value
     *     allowed object is
     *     {@link Root.Agent }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
    public void setAgent(Root.Agent value) {
        this.agent = value;
    }

    /**
     * Gets the value of the property property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the property property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getProperty().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link PropertyType }
     *
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
    public List<PropertyType> getProperty() {
        if (property == null) {
            property = new ArrayList<PropertyType>();
        }
        return this.property;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
    public String toString() {
        final ToStringStrategy2 strategy = JAXBToStringStrategy.INSTANCE2;
        final StringBuilder buffer = new StringBuilder();
        append(null, buffer, strategy);
        return buffer.toString();
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
    public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
        strategy.appendStart(locator, this, buffer);
        appendFields(locator, buffer, strategy);
        strategy.appendEnd(locator, this, buffer);
        return buffer;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
    public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
        {
            KyeroType theKyero;
            theKyero = this.getKyero();
            strategy.appendField(locator, this, "kyero", buffer, theKyero, (this.kyero!= null));
        }
        {
            Root.Agent theAgent;
            theAgent = this.getAgent();
            strategy.appendField(locator, this, "agent", buffer, theAgent, (this.agent!= null));
        }
        {
            List<PropertyType> theProperty;
            theProperty = (((this.property!= null)&&(!this.property.isEmpty()))?this.getProperty():null);
            strategy.appendField(locator, this, "property", buffer, theProperty, ((this.property!= null)&&(!this.property.isEmpty())));
        }
        return buffer;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
    public Object clone() {
        return copyTo(createNewInstance());
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
    public Object copyTo(Object target) {
        final CopyStrategy2 strategy = JAXBCopyStrategy.INSTANCE2;
        return copyTo(null, target, strategy);
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
    public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) {
        final Object draftCopy = ((target == null)?createNewInstance():target);
        if (draftCopy instanceof Root) {
            final Root copy = ((Root) draftCopy);
            {
                Boolean kyeroShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.kyero!= null));
                if (kyeroShouldBeCopiedAndSet == Boolean.TRUE) {
                    KyeroType sourceKyero;
                    sourceKyero = this.getKyero();
                    KyeroType copyKyero = ((KyeroType) strategy.copy(LocatorUtils.property(locator, "kyero", sourceKyero), sourceKyero, (this.kyero!= null)));
                    copy.setKyero(copyKyero);
                } else {
                    if (kyeroShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.kyero = null;
                    }
                }
            }
            {
                Boolean agentShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.agent!= null));
                if (agentShouldBeCopiedAndSet == Boolean.TRUE) {
                    Root.Agent sourceAgent;
                    sourceAgent = this.getAgent();
                    Root.Agent copyAgent = ((Root.Agent) strategy.copy(LocatorUtils.property(locator, "agent", sourceAgent), sourceAgent, (this.agent!= null)));
                    copy.setAgent(copyAgent);
                } else {
                    if (agentShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.agent = null;
                    }
                }
            }
            {
                Boolean propertyShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, ((this.property!= null)&&(!this.property.isEmpty())));
                if (propertyShouldBeCopiedAndSet == Boolean.TRUE) {
                    List<PropertyType> sourceProperty;
                    sourceProperty = (((this.property!= null)&&(!this.property.isEmpty()))?this.getProperty():null);
                    @SuppressWarnings("unchecked")
                    List<PropertyType> copyProperty = ((List<PropertyType> ) strategy.copy(LocatorUtils.property(locator, "property", sourceProperty), sourceProperty, ((this.property!= null)&&(!this.property.isEmpty()))));
                    copy.property = null;
                    if (copyProperty!= null) {
                        List<PropertyType> uniquePropertyl = copy.getProperty();
                        uniquePropertyl.addAll(copyProperty);
                    }
                } else {
                    if (propertyShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.property = null;
                    }
                }
            }
        }
        return draftCopy;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
    public Object createNewInstance() {
        return new Root();
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
    public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy2 strategy) {
        if ((object == null)||(this.getClass()!= object.getClass())) {
            return false;
        }
        if (this == object) {
            return true;
        }
        final Root that = ((Root) object);
        {
            KyeroType lhsKyero;
            lhsKyero = this.getKyero();
            KyeroType rhsKyero;
            rhsKyero = that.getKyero();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "kyero", lhsKyero), LocatorUtils.property(thatLocator, "kyero", rhsKyero), lhsKyero, rhsKyero, (this.kyero!= null), (that.kyero!= null))) {
                return false;
            }
        }
        {
            Root.Agent lhsAgent;
            lhsAgent = this.getAgent();
            Root.Agent rhsAgent;
            rhsAgent = that.getAgent();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "agent", lhsAgent), LocatorUtils.property(thatLocator, "agent", rhsAgent), lhsAgent, rhsAgent, (this.agent!= null), (that.agent!= null))) {
                return false;
            }
        }
        {
            List<PropertyType> lhsProperty;
            lhsProperty = (((this.property!= null)&&(!this.property.isEmpty()))?this.getProperty():null);
            List<PropertyType> rhsProperty;
            rhsProperty = (((that.property!= null)&&(!that.property.isEmpty()))?that.getProperty():null);
            if (!strategy.equals(LocatorUtils.property(thisLocator, "property", lhsProperty), LocatorUtils.property(thatLocator, "property", rhsProperty), lhsProperty, rhsProperty, ((this.property!= null)&&(!this.property.isEmpty())), ((that.property!= null)&&(!that.property.isEmpty())))) {
                return false;
            }
        }
        return true;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
    public boolean equals(Object object) {
        final EqualsStrategy2 strategy = JAXBEqualsStrategy.INSTANCE2;
        return equals(null, null, object, strategy);
    }

    /**
     *
Java class for anonymous complex type.
     *
     *
The following schema fragment specifies the expected content contained within this class.
     *
     *

     * <complexType>
     *   <complexContent>
     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
     *       <all>
     *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}integer" minOccurs="0"/>
     *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
     *         <element name="email" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
     *         <element name="tel" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
     *         <element name="fax" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
     *         <element name="mob" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
     *         <element name="addr1" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
     *         <element name="addr2" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
     *         <element name="town" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
     *         <element name="region" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
     *         <element name="postcode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
     *         <element name="country" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
     *       </all>
     *     </restriction>
     *   </complexContent>
     * </complexType>
     *

     *
     *
     */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {

    })
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
    public static class Agent implements Serializable, Cloneable, CopyTo2, Equals2, ToString2
    {

        @XmlElement(type = String.class)
        @XmlJavaTypeAdapter(Adapter2 .class)
        @XmlSchemaType(name = "integer")
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        protected BigInteger id;
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        protected String name;
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        protected String email;
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        protected String tel;
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        protected String fax;
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        protected String mob;
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        protected String addr1;
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        protected String addr2;
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        protected String town;
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        protected String region;
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        protected String postcode;
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        protected String country;

        /**
         * Gets the value of the id property.
         *
         * @return
         *     possible object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public BigInteger getId() {
            return id;
        }

        /**
         * Sets the value of the id property.
         *
         * @param value
         *     allowed object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public void setId(BigInteger value) {
            this.id = value;
        }

        /**
         * Gets the value of the name property.
         *
         * @return
         *     possible object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public String getName() {
            return name;
        }

        /**
         * Sets the value of the name property.
         *
         * @param value
         *     allowed object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public void setName(String value) {
            this.name = value;
        }

        /**
         * Gets the value of the email property.
         *
         * @return
         *     possible object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public String getEmail() {
            return email;
        }

        /**
         * Sets the value of the email property.
         *
         * @param value
         *     allowed object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public void setEmail(String value) {
            this.email = value;
        }

        /**
         * Gets the value of the tel property.
         *
         * @return
         *     possible object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public String getTel() {
            return tel;
        }

        /**
         * Sets the value of the tel property.
         *
         * @param value
         *     allowed object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public void setTel(String value) {
            this.tel = value;
        }

        /**
         * Gets the value of the fax property.
         *
         * @return
         *     possible object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public String getFax() {
            return fax;
        }

        /**
         * Sets the value of the fax property.
         *
         * @param value
         *     allowed object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public void setFax(String value) {
            this.fax = value;
        }

        /**
         * Gets the value of the mob property.
         *
         * @return
         *     possible object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public String getMob() {
            return mob;
        }

        /**
         * Sets the value of the mob property.
         *
         * @param value
         *     allowed object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public void setMob(String value) {
            this.mob = value;
        }

        /**
         * Gets the value of the addr1 property.
         *
         * @return
         *     possible object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public String getAddr1() {
            return addr1;
        }

        /**
         * Sets the value of the addr1 property.
         *
         * @param value
         *     allowed object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public void setAddr1(String value) {
            this.addr1 = value;
        }

        /**
         * Gets the value of the addr2 property.
         *
         * @return
         *     possible object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public String getAddr2() {
            return addr2;
        }

        /**
         * Sets the value of the addr2 property.
         *
         * @param value
         *     allowed object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public void setAddr2(String value) {
            this.addr2 = value;
        }

        /**
         * Gets the value of the town property.
         *
         * @return
         *     possible object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public String getTown() {
            return town;
        }

        /**
         * Sets the value of the town property.
         *
         * @param value
         *     allowed object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public void setTown(String value) {
            this.town = value;
        }

        /**
         * Gets the value of the region property.
         *
         * @return
         *     possible object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public String getRegion() {
            return region;
        }

        /**
         * Sets the value of the region property.
         *
         * @param value
         *     allowed object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public void setRegion(String value) {
            this.region = value;
        }

        /**
         * Gets the value of the postcode property.
         *
         * @return
         *     possible object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public String getPostcode() {
            return postcode;
        }

        /**
         * Sets the value of the postcode property.
         *
         * @param value
         *     allowed object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public void setPostcode(String value) {
            this.postcode = value;
        }

        /**
         * Gets the value of the country property.
         *
         * @return
         *     possible object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public String getCountry() {
            return country;
        }

        /**
         * Sets the value of the country property.
         *
         * @param value
         *     allowed object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public void setCountry(String value) {
            this.country = value;
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public String toString() {
            final ToStringStrategy2 strategy = JAXBToStringStrategy.INSTANCE2;
            final StringBuilder buffer = new StringBuilder();
            append(null, buffer, strategy);
            return buffer.toString();
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
            strategy.appendStart(locator, this, buffer);
            appendFields(locator, buffer, strategy);
            strategy.appendEnd(locator, this, buffer);
            return buffer;
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
            {
                BigInteger theId;
                theId = this.getId();
                strategy.appendField(locator, this, "id", buffer, theId, (this.id!= null));
            }
            {
                String theName;
                theName = this.getName();
                strategy.appendField(locator, this, "name", buffer, theName, (this.name!= null));
            }
            {
                String theEmail;
                theEmail = this.getEmail();
                strategy.appendField(locator, this, "email", buffer, theEmail, (this.email!= null));
            }
            {
                String theTel;
                theTel = this.getTel();
                strategy.appendField(locator, this, "tel", buffer, theTel, (this.tel!= null));
            }
            {
                String theFax;
                theFax = this.getFax();
                strategy.appendField(locator, this, "fax", buffer, theFax, (this.fax!= null));
            }
            {
                String theMob;
                theMob = this.getMob();
                strategy.appendField(locator, this, "mob", buffer, theMob, (this.mob!= null));
            }
            {
                String theAddr1;
                theAddr1 = this.getAddr1();
                strategy.appendField(locator, this, "addr1", buffer, theAddr1, (this.addr1 != null));
            }
            {
                String theAddr2;
                theAddr2 = this.getAddr2();
                strategy.appendField(locator, this, "addr2", buffer, theAddr2, (this.addr2 != null));
            }
            {
                String theTown;
                theTown = this.getTown();
                strategy.appendField(locator, this, "town", buffer, theTown, (this.town!= null));
            }
            {
                String theRegion;
                theRegion = this.getRegion();
                strategy.appendField(locator, this, "region", buffer, theRegion, (this.region!= null));
            }
            {
                String thePostcode;
                thePostcode = this.getPostcode();
                strategy.appendField(locator, this, "postcode", buffer, thePostcode, (this.postcode!= null));
            }
            {
                String theCountry;
                theCountry = this.getCountry();
                strategy.appendField(locator, this, "country", buffer, theCountry, (this.country!= null));
            }
            return buffer;
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public Object clone() {
            return copyTo(createNewInstance());
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public Object copyTo(Object target) {
            final CopyStrategy2 strategy = JAXBCopyStrategy.INSTANCE2;
            return copyTo(null, target, strategy);
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) {
            final Object draftCopy = ((target == null)?createNewInstance():target);
            if (draftCopy instanceof Root.Agent) {
                final Root.Agent copy = ((Root.Agent) draftCopy);
                {
                    Boolean idShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.id!= null));
                    if (idShouldBeCopiedAndSet == Boolean.TRUE) {
                        BigInteger sourceId;
                        sourceId = this.getId();
                        BigInteger copyId = ((BigInteger) strategy.copy(LocatorUtils.property(locator, "id", sourceId), sourceId, (this.id!= null)));
                        copy.setId(copyId);
                    } else {
                        if (idShouldBeCopiedAndSet == Boolean.FALSE) {
                            copy.id = null;
                        }
                    }
                }
                {
                    Boolean nameShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.name!= null));
                    if (nameShouldBeCopiedAndSet == Boolean.TRUE) {
                        String sourceName;
                        sourceName = this.getName();
                        String copyName = ((String) strategy.copy(LocatorUtils.property(locator, "name", sourceName), sourceName, (this.name!= null)));
                        copy.setName(copyName);
                    } else {
                        if (nameShouldBeCopiedAndSet == Boolean.FALSE) {
                            copy.name = null;
                        }
                    }
                }
                {
                    Boolean emailShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.email!= null));
                    if (emailShouldBeCopiedAndSet == Boolean.TRUE) {
                        String sourceEmail;
                        sourceEmail = this.getEmail();
                        String copyEmail = ((String) strategy.copy(LocatorUtils.property(locator, "email", sourceEmail), sourceEmail, (this.email!= null)));
                        copy.setEmail(copyEmail);
                    } else {
                        if (emailShouldBeCopiedAndSet == Boolean.FALSE) {
                            copy.email = null;
                        }
                    }
                }
                {
                    Boolean telShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.tel!= null));
                    if (telShouldBeCopiedAndSet == Boolean.TRUE) {
                        String sourceTel;
                        sourceTel = this.getTel();
                        String copyTel = ((String) strategy.copy(LocatorUtils.property(locator, "tel", sourceTel), sourceTel, (this.tel!= null)));
                        copy.setTel(copyTel);
                    } else {
                        if (telShouldBeCopiedAndSet == Boolean.FALSE) {
                            copy.tel = null;
                        }
                    }
                }
                {
                    Boolean faxShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.fax!= null));
                    if (faxShouldBeCopiedAndSet == Boolean.TRUE) {
                        String sourceFax;
                        sourceFax = this.getFax();
                        String copyFax = ((String) strategy.copy(LocatorUtils.property(locator, "fax", sourceFax), sourceFax, (this.fax!= null)));
                        copy.setFax(copyFax);
                    } else {
                        if (faxShouldBeCopiedAndSet == Boolean.FALSE) {
                            copy.fax = null;
                        }
                    }
                }
                {
                    Boolean mobShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.mob!= null));
                    if (mobShouldBeCopiedAndSet == Boolean.TRUE) {
                        String sourceMob;
                        sourceMob = this.getMob();
                        String copyMob = ((String) strategy.copy(LocatorUtils.property(locator, "mob", sourceMob), sourceMob, (this.mob!= null)));
                        copy.setMob(copyMob);
                    } else {
                        if (mobShouldBeCopiedAndSet == Boolean.FALSE) {
                            copy.mob = null;
                        }
                    }
                }
                {
                    Boolean addr1ShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.addr1 != null));
                    if (addr1ShouldBeCopiedAndSet == Boolean.TRUE) {
                        String sourceAddr1;
                        sourceAddr1 = this.getAddr1();
                        String copyAddr1 = ((String) strategy.copy(LocatorUtils.property(locator, "addr1", sourceAddr1), sourceAddr1, (this.addr1 != null)));
                        copy.setAddr1(copyAddr1);
                    } else {
                        if (addr1ShouldBeCopiedAndSet == Boolean.FALSE) {
                            copy.addr1 = null;
                        }
                    }
                }
                {
                    Boolean addr2ShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.addr2 != null));
                    if (addr2ShouldBeCopiedAndSet == Boolean.TRUE) {
                        String sourceAddr2;
                        sourceAddr2 = this.getAddr2();
                        String copyAddr2 = ((String) strategy.copy(LocatorUtils.property(locator, "addr2", sourceAddr2), sourceAddr2, (this.addr2 != null)));
                        copy.setAddr2(copyAddr2);
                    } else {
                        if (addr2ShouldBeCopiedAndSet == Boolean.FALSE) {
                            copy.addr2 = null;
                        }
                    }
                }
                {
                    Boolean townShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.town!= null));
                    if (townShouldBeCopiedAndSet == Boolean.TRUE) {
                        String sourceTown;
                        sourceTown = this.getTown();
                        String copyTown = ((String) strategy.copy(LocatorUtils.property(locator, "town", sourceTown), sourceTown, (this.town!= null)));
                        copy.setTown(copyTown);
                    } else {
                        if (townShouldBeCopiedAndSet == Boolean.FALSE) {
                            copy.town = null;
                        }
                    }
                }
                {
                    Boolean regionShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.region!= null));
                    if (regionShouldBeCopiedAndSet == Boolean.TRUE) {
                        String sourceRegion;
                        sourceRegion = this.getRegion();
                        String copyRegion = ((String) strategy.copy(LocatorUtils.property(locator, "region", sourceRegion), sourceRegion, (this.region!= null)));
                        copy.setRegion(copyRegion);
                    } else {
                        if (regionShouldBeCopiedAndSet == Boolean.FALSE) {
                            copy.region = null;
                        }
                    }
                }
                {
                    Boolean postcodeShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.postcode!= null));
                    if (postcodeShouldBeCopiedAndSet == Boolean.TRUE) {
                        String sourcePostcode;
                        sourcePostcode = this.getPostcode();
                        String copyPostcode = ((String) strategy.copy(LocatorUtils.property(locator, "postcode", sourcePostcode), sourcePostcode, (this.postcode!= null)));
                        copy.setPostcode(copyPostcode);
                    } else {
                        if (postcodeShouldBeCopiedAndSet == Boolean.FALSE) {
                            copy.postcode = null;
                        }
                    }
                }
                {
                    Boolean countryShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.country!= null));
                    if (countryShouldBeCopiedAndSet == Boolean.TRUE) {
                        String sourceCountry;
                        sourceCountry = this.getCountry();
                        String copyCountry = ((String) strategy.copy(LocatorUtils.property(locator, "country", sourceCountry), sourceCountry, (this.country!= null)));
                        copy.setCountry(copyCountry);
                    } else {
                        if (countryShouldBeCopiedAndSet == Boolean.FALSE) {
                            copy.country = null;
                        }
                    }
                }
            }
            return draftCopy;
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public Object createNewInstance() {
            return new Root.Agent();
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy2 strategy) {
            if ((object == null)||(this.getClass()!= object.getClass())) {
                return false;
            }
            if (this == object) {
                return true;
            }
            final Root.Agent that = ((Root.Agent) object);
            {
                BigInteger lhsId;
                lhsId = this.getId();
                BigInteger rhsId;
                rhsId = that.getId();
                if (!strategy.equals(LocatorUtils.property(thisLocator, "id", lhsId), LocatorUtils.property(thatLocator, "id", rhsId), lhsId, rhsId, (this.id!= null), (that.id!= null))) {
                    return false;
                }
            }
            {
                String lhsName;
                lhsName = this.getName();
                String rhsName;
                rhsName = that.getName();
                if (!strategy.equals(LocatorUtils.property(thisLocator, "name", lhsName), LocatorUtils.property(thatLocator, "name", rhsName), lhsName, rhsName, (this.name!= null), (that.name!= null))) {
                    return false;
                }
            }
            {
                String lhsEmail;
                lhsEmail = this.getEmail();
                String rhsEmail;
                rhsEmail = that.getEmail();
                if (!strategy.equals(LocatorUtils.property(thisLocator, "email", lhsEmail), LocatorUtils.property(thatLocator, "email", rhsEmail), lhsEmail, rhsEmail, (this.email!= null), (that.email!= null))) {
                    return false;
                }
            }
            {
                String lhsTel;
                lhsTel = this.getTel();
                String rhsTel;
                rhsTel = that.getTel();
                if (!strategy.equals(LocatorUtils.property(thisLocator, "tel", lhsTel), LocatorUtils.property(thatLocator, "tel", rhsTel), lhsTel, rhsTel, (this.tel!= null), (that.tel!= null))) {
                    return false;
                }
            }
            {
                String lhsFax;
                lhsFax = this.getFax();
                String rhsFax;
                rhsFax = that.getFax();
                if (!strategy.equals(LocatorUtils.property(thisLocator, "fax", lhsFax), LocatorUtils.property(thatLocator, "fax", rhsFax), lhsFax, rhsFax, (this.fax!= null), (that.fax!= null))) {
                    return false;
                }
            }
            {
                String lhsMob;
                lhsMob = this.getMob();
                String rhsMob;
                rhsMob = that.getMob();
                if (!strategy.equals(LocatorUtils.property(thisLocator, "mob", lhsMob), LocatorUtils.property(thatLocator, "mob", rhsMob), lhsMob, rhsMob, (this.mob!= null), (that.mob!= null))) {
                    return false;
                }
            }
            {
                String lhsAddr1;
                lhsAddr1 = this.getAddr1();
                String rhsAddr1;
                rhsAddr1 = that.getAddr1();
                if (!strategy.equals(LocatorUtils.property(thisLocator, "addr1", lhsAddr1), LocatorUtils.property(thatLocator, "addr1", rhsAddr1), lhsAddr1, rhsAddr1, (this.addr1 != null), (that.addr1 != null))) {
                    return false;
                }
            }
            {
                String lhsAddr2;
                lhsAddr2 = this.getAddr2();
                String rhsAddr2;
                rhsAddr2 = that.getAddr2();
                if (!strategy.equals(LocatorUtils.property(thisLocator, "addr2", lhsAddr2), LocatorUtils.property(thatLocator, "addr2", rhsAddr2), lhsAddr2, rhsAddr2, (this.addr2 != null), (that.addr2 != null))) {
                    return false;
                }
            }
            {
                String lhsTown;
                lhsTown = this.getTown();
                String rhsTown;
                rhsTown = that.getTown();
                if (!strategy.equals(LocatorUtils.property(thisLocator, "town", lhsTown), LocatorUtils.property(thatLocator, "town", rhsTown), lhsTown, rhsTown, (this.town!= null), (that.town!= null))) {
                    return false;
                }
            }
            {
                String lhsRegion;
                lhsRegion = this.getRegion();
                String rhsRegion;
                rhsRegion = that.getRegion();
                if (!strategy.equals(LocatorUtils.property(thisLocator, "region", lhsRegion), LocatorUtils.property(thatLocator, "region", rhsRegion), lhsRegion, rhsRegion, (this.region!= null), (that.region!= null))) {
                    return false;
                }
            }
            {
                String lhsPostcode;
                lhsPostcode = this.getPostcode();
                String rhsPostcode;
                rhsPostcode = that.getPostcode();
                if (!strategy.equals(LocatorUtils.property(thisLocator, "postcode", lhsPostcode), LocatorUtils.property(thatLocator, "postcode", rhsPostcode), lhsPostcode, rhsPostcode, (this.postcode!= null), (that.postcode!= null))) {
                    return false;
                }
            }
            {
                String lhsCountry;
                lhsCountry = this.getCountry();
                String rhsCountry;
                rhsCountry = that.getCountry();
                if (!strategy.equals(LocatorUtils.property(thisLocator, "country", lhsCountry), LocatorUtils.property(thatLocator, "country", rhsCountry), lhsCountry, rhsCountry, (this.country!= null), (that.country!= null))) {
                    return false;
                }
            }
            return true;
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2021-08-07T06:31:05+02:00", comments = "JAXB RI v2.3.0")
        public boolean equals(Object object) {
            final EqualsStrategy2 strategy = JAXBEqualsStrategy.INSTANCE2;
            return equals(null, null, object, strategy);
        }

    }

}


text:
#include "unit_test.h"
#include "trace.h"
#include "tick_util.h"

#ifdef WIN32
#include <vld.h> // Visual Leak Detector
#endif

#ifdef WIN32
#pragma message("Using Google C++ Testing Framework")
#endif

using namespace webrtc;

void TestSize(VideoFrame& sourceFrame, WebRtc_UWord32 targetWidth, WebRtc_UWord32 targetHeight,
              WebRtc_UWord32 mode, VideoProcessingModule *vpm);

class VPMEnvironment : public ::testing::Environment
{
public:
    virtual void SetUp()
    {
        Trace::CreateTrace();
        ASSERT_EQ(0, Trace::SetTraceFile("VPMTrace.txt"));
    }

    virtual void TearDown()
    {
        Trace::ReturnTrace();
    }
};
VideoProcessingModuleTest::VideoProcessingModuleTest() :
    _vpm(NULL),
    _sourceFile(NULL),
    _width(352),
    _height(288),
    _frameLength(CalcBufferSize(kI420, 352, 288))
{
}

void VideoProcessingModuleTest::SetUp()
{
    _vpm = VideoProcessingModule::Create(0);
    ASSERT_TRUE(_vpm != NULL);

    ASSERT_EQ(0, _videoFrame.VerifyAndAllocate(_frameLength));
    _videoFrame.SetWidth(_width);
    _videoFrame.SetHeight(_height);

    _sourceFile  = fopen("testFiles/foreman_cif.yuv","rb");
    ASSERT_TRUE(_sourceFile != NULL) <<
        "Cannot read source file: testFiles/foreman_cif.yuv\n";
}

void VideoProcessingModuleTest::TearDown()
{
    if (_sourceFile != NULL)
    {
        ASSERT_EQ(0, fclose(_sourceFile));
    }
    _sourceFile = NULL;

    if (_vpm != NULL)
    {
        VideoProcessingModule::Destroy(_vpm);
    }
    _vpm = NULL;
}

TEST_F(VideoProcessingModuleTest, GetVersionTest)
{
    WebRtc_Word8 version[255];
    WebRtc_UWord32 remainingBuffer = sizeof(version);
    WebRtc_UWord32 position = 0;

    EXPECT_EQ(-1, VideoProcessingModule::GetVersion(NULL, remainingBuffer, position));
    EXPECT_EQ(-1, _vpm->GetVersion(NULL, remainingBuffer, position));

    WebRtc_UWord32 badRemainingBuffer = 5;
    EXPECT_EQ(-3, VideoProcessingModule::GetVersion(version, badRemainingBuffer, position));
    EXPECT_EQ(-3, _vpm->GetVersion(version, badRemainingBuffer, position));

    EXPECT_EQ(0, VideoProcessingModule::GetVersion(version, remainingBuffer, position));
    EXPECT_EQ(remainingBuffer, sizeof(version) - position);
    printf("\n%s\n\n", version);

    EXPECT_EQ(0, _vpm->GetVersion(&version[position], remainingBuffer, position));
    EXPECT_EQ(remainingBuffer, sizeof(version) - position);
}

TEST_F(VideoProcessingModuleTest, HandleNullBuffer)
{
    VideoProcessingModule::FrameStats stats;
    ASSERT_EQ(0, _vpm->GetFrameStats(stats, _videoFrame));
    // Video frame with unallocated buffer.
    VideoFrame videoFrame;
    videoFrame.SetWidth(_width);
    videoFrame.SetHeight(_height);

    EXPECT_EQ(-3, _vpm->GetFrameStats(stats, NULL, _width, _height));
    EXPECT_EQ(-3, _vpm->GetFrameStats(stats, videoFrame));

    EXPECT_EQ(-1, _vpm->ColorEnhancement(NULL, _width, _height));
    EXPECT_EQ(-1, _vpm->ColorEnhancement(videoFrame));

    EXPECT_EQ(-1, _vpm->Deflickering(NULL, _width, _height, 0, stats));
    EXPECT_EQ(-1, _vpm->Deflickering(videoFrame, stats));

    EXPECT_EQ(-1, _vpm->Denoising(NULL, _width, _height));
    EXPECT_EQ(-1, _vpm->Denoising(videoFrame));

    EXPECT_EQ(-3, _vpm->BrightnessDetection(NULL, _width, _height, stats));
    EXPECT_EQ(-3, _vpm->BrightnessDetection(videoFrame, stats));

    EXPECT_EQ(VPM_PARAMETER_ERROR, _vpm->PreprocessFrame(NULL, NULL));

}

TEST_F(VideoProcessingModuleTest, HandleBadStats)
{
    VideoProcessingModule::FrameStats stats;

    ASSERT_EQ(_frameLength, fread(_videoFrame.Buffer(), 1, _frameLength, _sourceFile));

    EXPECT_EQ(-1, _vpm->Deflickering(_videoFrame.Buffer(), _width, _height, 0, stats));
    EXPECT_EQ(-1, _vpm->Deflickering(_videoFrame, stats));

    EXPECT_EQ(-3, _vpm->BrightnessDetection(_videoFrame.Buffer(), _width, _height, stats));
    EXPECT_EQ(-3, _vpm->BrightnessDetection(_videoFrame, stats));
}

TEST_F(VideoProcessingModuleTest, HandleBadSize)
{
    VideoProcessingModule::FrameStats stats;
    ASSERT_EQ(0, _vpm->GetFrameStats(stats, _videoFrame));

    // Bad width
    _videoFrame.SetWidth(0);
    EXPECT_EQ(-3, _vpm->GetFrameStats(stats, _videoFrame.Buffer(), 0, _height));
    EXPECT_EQ(-3, _vpm->GetFrameStats(stats, _videoFrame));

    EXPECT_EQ(-1, _vpm->ColorEnhancement(_videoFrame.Buffer(), 0, _height));
    EXPECT_EQ(-1, _vpm->ColorEnhancement(_videoFrame));

    EXPECT_EQ(-1, _vpm->Deflickering(_videoFrame.Buffer(), 0, _height, 0, stats));
    EXPECT_EQ(-1, _vpm->Deflickering(_videoFrame, stats));

    EXPECT_EQ(-1, _vpm->Denoising(_videoFrame.Buffer(), 0, _height));
    EXPECT_EQ(-1, _vpm->Denoising(_videoFrame));

    EXPECT_EQ(-3, _vpm->BrightnessDetection(_videoFrame.Buffer(), 0, _height, stats));
    EXPECT_EQ(-3, _vpm->BrightnessDetection(_videoFrame, stats));

    // Bad height
    _videoFrame.SetWidth(_width);
    _videoFrame.SetHeight(0);
    EXPECT_EQ(-3, _vpm->GetFrameStats(stats, _videoFrame.Buffer(), _width, 0));
    EXPECT_EQ(-3, _vpm->GetFrameStats(stats, _videoFrame));

    EXPECT_EQ(-1, _vpm->ColorEnhancement(_videoFrame.Buffer(), _width, 0));
    EXPECT_EQ(-1, _vpm->ColorEnhancement(_videoFrame));

    EXPECT_EQ(-1, _vpm->Deflickering(_videoFrame.Buffer(), _width, 0, 0, stats));
    EXPECT_EQ(-1, _vpm->Deflickering(_videoFrame, stats));

    EXPECT_EQ(-1, _vpm->Denoising(_videoFrame.Buffer(), _width, 0));
    EXPECT_EQ(-1, _vpm->Denoising(_videoFrame));

    EXPECT_EQ(-3, _vpm->BrightnessDetection(_videoFrame.Buffer(), _width, 0, stats));
    EXPECT_EQ(-3, _vpm->BrightnessDetection(_videoFrame, stats));

    EXPECT_EQ(VPM_PARAMETER_ERROR, _vpm->SetTargetResolution(0,0,0));
    EXPECT_EQ(VPM_PARAMETER_ERROR, _vpm->SetMaxFrameRate(0));

    VideoFrame *outFrame = NULL;
    EXPECT_EQ(VPM_PARAMETER_ERROR, _vpm->PreprocessFrame(&_videoFrame, &outFrame));

}

TEST_F(VideoProcessingModuleTest, IdenticalResultsAfterReset)
{
    VideoFrame videoFrame2;
    VideoProcessingModule::FrameStats stats;

    ASSERT_EQ(0, videoFrame2.VerifyAndAllocate(_frameLength));
    videoFrame2.SetWidth(_width);
    videoFrame2.SetHeight(_height);

    // Only testing non-static functions here.
    ASSERT_EQ(_frameLength, fread(_videoFrame.Buffer(), 1, _frameLength, _sourceFile));
    ASSERT_EQ(0, _vpm->GetFrameStats(stats, _videoFrame));
    memcpy(videoFrame2.Buffer(), _videoFrame.Buffer(), _frameLength);
    ASSERT_EQ(0, _vpm->Deflickering(_videoFrame, stats));
    _vpm->Reset();
    // Retrieve frame stats again in case Deflickering() has zeroed them.
    ASSERT_EQ(0, _vpm->GetFrameStats(stats, videoFrame2));
    ASSERT_EQ(0, _vpm->Deflickering(videoFrame2, stats));
    EXPECT_EQ(0, memcmp(_videoFrame.Buffer(), videoFrame2.Buffer(), _frameLength));

    ASSERT_EQ(_frameLength, fread(_videoFrame.Buffer(), 1, _frameLength, _sourceFile));
    memcpy(videoFrame2.Buffer(), _videoFrame.Buffer(), _frameLength);
    ASSERT_GE(_vpm->Denoising(_videoFrame), 0);
    _vpm->Reset();
    ASSERT_GE(_vpm->Denoising(videoFrame2), 0);
    EXPECT_EQ(0, memcmp(_videoFrame.Buffer(), videoFrame2.Buffer(), _frameLength));

    ASSERT_EQ(_frameLength, fread(_videoFrame.Buffer(), 1, _frameLength, _sourceFile));
    ASSERT_EQ(0, _vpm->GetFrameStats(stats, _videoFrame));
    memcpy(videoFrame2.Buffer(), _videoFrame.Buffer(), _frameLength);
    ASSERT_EQ(0, _vpm->BrightnessDetection(_videoFrame, stats));
    _vpm->Reset();
    ASSERT_EQ(0, _vpm->BrightnessDetection(videoFrame2, stats));
    EXPECT_EQ(0, memcmp(_videoFrame.Buffer(), videoFrame2.Buffer(), _frameLength));

}

TEST_F(VideoProcessingModuleTest, FrameStats)
{
    VideoProcessingModule::FrameStats stats;
    ASSERT_EQ(_frameLength, fread(_videoFrame.Buffer(), 1, _frameLength, _sourceFile));

    EXPECT_EQ(false, _vpm->ValidFrameStats(stats));
    EXPECT_EQ(0, _vpm->GetFrameStats(stats, _videoFrame));
    EXPECT_EQ(true, _vpm->ValidFrameStats(stats));

    printf("\nFrameStats\n");
    printf("mean: %u\nnumPixels: %u\nsubSamplWidth: %u\nsumSamplHeight: %u\nsum: %u\n\n",
        static_cast<unsigned int>(stats.mean),
        static_cast<unsigned int>(stats.numPixels),
        static_cast<unsigned int>(stats.subSamplHeight),
        static_cast<unsigned int>(stats.subSamplWidth),
        static_cast<unsigned int>(stats.sum));

    _vpm->ClearFrameStats(stats);
    EXPECT_EQ(false, _vpm->ValidFrameStats(stats));
}

TEST_F(VideoProcessingModuleTest, PreprocessorLogic)
{
    // disable temporal sampling
    _vpm->EnableTemporalDecimation(false);
    ASSERT_EQ(VPM_OK, _vpm->SetMaxFrameRate(30));
    ASSERT_EQ(VPM_OK, _vpm->SetTargetResolution(100, 100, 15));
    //revert
    _vpm->EnableTemporalDecimation(true);
    ASSERT_EQ(VPM_OK, _vpm->SetTargetResolution(100, 100, 30));
    // disable spatial sampling
    _vpm->SetInputFrameResampleMode(kNoRescaling);
    ASSERT_EQ(VPM_OK, _vpm->SetTargetResolution(100, 100, 30));
    VideoFrame *outFrame = NULL;
    ASSERT_EQ(VPM_OK, _vpm->PreprocessFrame(&_videoFrame, &outFrame));
    ASSERT_EQ(_videoFrame.Height() , outFrame->Height());
    ASSERT_EQ(_videoFrame.Width() , outFrame->Width());

}

TEST_F(VideoProcessingModuleTest, Resampler)
{
    enum { NumRuns = 1 };
    WebRtc_UWord32 frameNum = 0;

    WebRtc_Word64 minRuntime = 0;
    WebRtc_Word64 avgRuntime = 0;

    TickTime t0;
    TickTime t1;
    TickInterval accTicks;
    WebRtc_Word32 modifiedPixels = 0;
    WebRtc_Word32 height = 288;
    WebRtc_Word32 width = 352;
    WebRtc_Word32 lengthSourceFrame = width*height*3/2;

    rewind(_sourceFile);
    ASSERT_TRUE(_sourceFile != NULL) <<
        "Cannot read input file \n";

    // CA not needed here
    _vpm->EnableContentAnalysis(false);
    // no temporal decimation
    _vpm->EnableTemporalDecimation(false);

    // reading test frame
    VideoFrame sourceFrame;
    ASSERT_EQ(0, sourceFrame.VerifyAndAllocate(lengthSourceFrame));
    fread(sourceFrame.Buffer(), 1, lengthSourceFrame, _sourceFile);
    ASSERT_EQ(0, sourceFrame.SetLength(lengthSourceFrame));
    sourceFrame.SetHeight(height);
    sourceFrame.SetWidth(width);

    for (WebRtc_UWord32 runIdx = 0; runIdx < NumRuns; runIdx++)
    {
        // initiate test timer
        t0 = TickTime::Now();

        // kFastRescaling
        _vpm->SetInputFrameResampleMode(kFastRescaling);
        //TESTING DIFFERENT SIZES
        TestSize(sourceFrame, 100, 50, 1, _vpm);          // Cut, decimation 1x, interpolate
        TestSize(sourceFrame, 352/2, 288/2, 1, _vpm);     // Even decimation
        TestSize(sourceFrame, 352, 288, 1, _vpm);         // No resampling
        TestSize(sourceFrame, 2*352, 2*288,1,  _vpm);     // Even upsampling
        TestSize(sourceFrame, 400, 256, 1, _vpm);         // Upsampling 1.5x and cut
        TestSize(sourceFrame, 960, 720, 1, _vpm);         // Upsampling 3.5x and cut
        TestSize(sourceFrame, 1280, 720, 1, _vpm);        // Upsampling 4x and cut

        //kBiLinear
        _vpm->SetInputFrameResampleMode(kBiLinear);
        //TESTING DIFFERENT SIZES
        TestSize(sourceFrame, 352/4, 288/4, 2, _vpm);
        TestSize(sourceFrame, 352/2, 288/2, 2, _vpm);
        TestSize(sourceFrame, 2*352, 2*288,2, _vpm);
        TestSize(sourceFrame, 480, 640, 2, _vpm);
        TestSize(sourceFrame, 960, 720, 2, _vpm);
        TestSize(sourceFrame, 1280, 720, 2, _vpm);
        // stop timer
        t1 = TickTime::Now();
        accTicks += t1 - t0;

        if (accTicks.Microseconds() < minRuntime || runIdx == 0)
        {
            minRuntime = accTicks.Microseconds();
        }
        avgRuntime += accTicks.Microseconds();
    }

    sourceFrame.Free();

     printf("\nAverage run time = %d us / frame\n",
        //static_cast<int>(avgRuntime / frameNum / NumRuns));
        static_cast<int>(avgRuntime));
    printf("Min run time = %d us / frame\n\n",
        //static_cast<int>(minRuntime / frameNum));
        static_cast<int>(minRuntime));

}

void TestSize(VideoFrame& sourceFrame, WebRtc_UWord32 targetWidth, WebRtc_UWord32 targetHeight,
              WebRtc_UWord32 mode, VideoProcessingModule *vpm)
{
    VideoFrame *outFrame = NULL;
    std::ostringstream filename;
    filename << "Resampler_"<< mode <<"_" << targetWidth << "x" << targetHeight << "_30Hz_P420.yuv";
    std::cout << "Watch " << filename.str() << " and verify that it is okay." << std::endl;
    FILE* standAloneFile = fopen(filename.str().c_str(), "wb");
    ASSERT_EQ(VPM_OK, vpm->SetTargetResolution(targetWidth, targetHeight, 30));
    ASSERT_EQ(VPM_OK, vpm->PreprocessFrame(&sourceFrame, &outFrame));
    ASSERT_EQ((targetWidth * targetHeight * 3 / 2), outFrame->Length());

    // Write to file for visual inspection
    fwrite(outFrame->Buffer(), 1, outFrame->Length(), standAloneFile);

    outFrame->Free();
    fclose(standAloneFile);
}

int main(int argc, char** argv)
{

    ::testing::InitGoogleTest(&argc, argv);
    VPMEnvironment* env = new VPMEnvironment;
    ::testing::AddGlobalTestEnvironment(env);

    return RUN_ALL_TESTS();
}

redpajama_set_name: RedPajamaGithub


text:
package org.jkiss.dbeaver.ext.erd.editor.tools;

import org.eclipse.gef.commands.Command;
import org.eclipse.gef.ui.actions.SelectionAction;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.preference.ColorSelector;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.*;
import org.jkiss.dbeaver.ext.erd.editor.ERDEditorPart;
import org.jkiss.dbeaver.ext.erd.part.EntityPart;
import org.jkiss.dbeaver.ext.erd.part.ICustomizablePart;
import org.jkiss.dbeaver.ext.erd.part.NodePart;
import org.jkiss.dbeaver.ext.erd.part.NotePart;
import org.jkiss.dbeaver.ui.SharedFonts;
import org.jkiss.dbeaver.ui.UIUtils;
import org.jkiss.dbeaver.ui.dialogs.BaseDialog;
import org.jkiss.utils.CommonUtils;

import java.util.HashMap;
import java.util.Locale;
import java.util.Map;

public class SetPartSettingsAction extends SelectionAction {

    private static class ViewSettings {
        private Color background;
        private Color foreground;
        private int borderWidth;
        private boolean transparency;
        private String fontInfo;

    }

    private IStructuredSelection selection;

    public SetPartSettingsAction(ERDEditorPart part, IStructuredSelection selection) {
        super(part);
        this.selection = selection;

        this.setText("Customize ...");
        this.setToolTipText("Figure node view settings");
        this.setId("setPartSettings"); //$NON-NLS-1$
    }

    protected boolean calculateEnabled() {
        for (Object item : selection.toArray()) {
            if (item instanceof NodePart) {
                return true;
            }
        }
        return false;
    }

    protected void init() {
        super.init();
    }

    public void run() {
        this.execute(this.createColorCommand(selection.toArray()));
    }

    private Command createColorCommand(final Object[] objects) {
        return new Command() {
            private ViewSettings newSettings;
            private final Map<ICustomizablePart, ViewSettings> oldSettings = new HashMap<>();
            @Override
            public void execute() {
                final Shell shell = UIUtils.createCenteredShell(getWorkbenchPart().getSite().getShell());
                try {
                    NodePart nodePart = null;
                    boolean hasNotes = false, hasEntities = false;
                    for (Object item : objects) {
                        if (item instanceof NodePart) {
                            if (nodePart == null) {
                                nodePart = (NodePart) item;
                            }
                            if (item instanceof NotePart) {
                                hasNotes = true;
                            } else if (item instanceof EntityPart) {
                                hasEntities = true;
                            }
                        }
                    }

                    PartSettingsDialog settingsDialog = new PartSettingsDialog(shell, nodePart, hasNotes, hasEntities);
                    if (settingsDialog.open() != IDialogConstants.OK_ID) {
                        return;
                    }
                    newSettings = settingsDialog.newSettings;

                    for (Object item : objects) {
                        if (item instanceof ICustomizablePart) {
                            ICustomizablePart part = (ICustomizablePart) item;
                            ViewSettings oldSettings = new ViewSettings();
                            oldSettings.transparency = part.getCustomTransparency();
                            oldSettings.background = part.getCustomBackgroundColor();
                            oldSettings.foreground = part.getCustomForegroundColor();
                            oldSettings.borderWidth = part.getCustomBorderWidth();
                            oldSettings.fontInfo = SharedFonts.toString(part.getCustomFont());
                            this.oldSettings.put(part, oldSettings);

                            setNodeSettings(part, newSettings);
                        }
                    }
                } finally {
                    shell.dispose();
                }
            }

            @Override
            public void undo() {
                for (Object item : objects) {
                    if (item instanceof ICustomizablePart) {
                        ICustomizablePart colorizedPart = (ICustomizablePart) item;
                        ViewSettings viewSettings = oldSettings.get(colorizedPart);
                        if (viewSettings != null) {
                            setNodeSettings(colorizedPart, viewSettings);
                        }
                    }
                }
            }

            @Override
            public void redo() {
                for (Object item : objects) {
                    if (item instanceof ICustomizablePart) {
                        setNodeSettings((ICustomizablePart) item, newSettings);
                    }
                }
            }

            private void setNodeSettings(ICustomizablePart part, ViewSettings settings) {
                if (part instanceof NotePart) {
                    part.setCustomTransparency(settings.transparency);
                }
                part.setCustomBackgroundColor(settings.background);
                if (part instanceof NotePart) {
                    part.setCustomForegroundColor(settings.foreground);
                    part.setCustomBorderWidth(settings.borderWidth);
                    part.setCustomFont(UIUtils.getSharedFonts().getFont(
                        Display.getCurrent(),
                        settings.fontInfo));
                }
            }
        };
    }

    private static class PartSettingsDialog extends BaseDialog {

        private final NodePart node;
        private final boolean noteStyles;
        private final boolean entityStyles;
        private Button transparentCheckbox;
        private ColorSelector backgroundColorPicker;
        private ColorSelector foregroundColorPicker;
        private Text borderWidthText;
        private String fontData;
        private ViewSettings newSettings = new ViewSettings();

        public PartSettingsDialog(Shell parentShell, NodePart node, boolean noteStyles, boolean entityStyles) {
            super(parentShell, "Node view settings", null);
            this.node = node;
            this.noteStyles = noteStyles;
            this.entityStyles = entityStyles;
        }

        @Override
        protected Composite createDialogArea(Composite parent) {
            Composite dialogArea = super.createDialogArea(parent);

            Group settingsGroup = UIUtils.createControlGroup(dialogArea, "Settings", 2, GridData.FILL_HORIZONTAL, 0);

            if (noteStyles) {
                transparentCheckbox = UIUtils.createCheckbox(settingsGroup, "Transparent", "Make figure transparent (no background)",
                    node != null && node.getCustomTransparency(), 2);
            }
            UIUtils.createControlLabel(settingsGroup, "Background");
            backgroundColorPicker = new ColorSelector(settingsGroup);
            if (node != null) {
                backgroundColorPicker.setColorValue(node.getCustomBackgroundColor().getRGB());
            }
            if (noteStyles) {
                UIUtils.createControlLabel(settingsGroup, "Foreground");
                foregroundColorPicker = new ColorSelector(settingsGroup);
                if (node != null) {
                    foregroundColorPicker.setColorValue(node.getCustomForegroundColor().getRGB());
                }

                borderWidthText = UIUtils.createLabelText(settingsGroup, "Border width", String.valueOf(node == null ? 1 : node.getCustomBorderWidth()));
                GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
                gd.widthHint = 30;
                borderWidthText.setLayoutData(gd);
                borderWidthText.addVerifyListener(UIUtils.getIntegerVerifyListener(Locale.ENGLISH));

                UIUtils.createControlLabel(settingsGroup, "Font");
                Button changeFontButton = UIUtils.createPushButton(settingsGroup, "Customize...", null, null);
                changeFontButton.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));

                Text previewText = new Text(settingsGroup, SWT.BORDER | SWT.READ_ONLY | SWT.MULTI);
                previewText.setText("ERD Node Text");
                gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
                gd.horizontalSpan = 2;
                previewText.setLayoutData(gd);
                if (node != null) {
                    previewText.setFont(node.getCustomFont());
                    fontData = SharedFonts.toString(node.getCustomFont().getFontData()[0]);
                }

                changeFontButton.addSelectionListener(new SelectionAdapter() {
                    @Override
                    public void widgetSelected(SelectionEvent e) {
                        FontDialog fontDialog = new FontDialog(getShell(), SWT.NONE);
                        fontDialog.setFontList(previewText.getFont().getFontData());
                        FontData result = fontDialog.open();
                        if (result != null) {
                            fontData = SharedFonts.toString(result);
                            previewText.setFont(UIUtils.getSharedFonts().getFont(previewText.getDisplay(), result));
                            settingsGroup.layout(true, true);
                        }
                    }
                });
            }

            return dialogArea;
        }

        @Override
        protected void okPressed() {
            newSettings = new ViewSettings();
            newSettings.background = getBackgroundColor();
            newSettings.foreground = getForegroundColorPicker();
            newSettings.transparency = isTransparent();
            newSettings.borderWidth = getBorderWidth();
            newSettings.fontInfo = getFontData();
            super.okPressed();
        }

        public boolean isTransparent() {
            return transparentCheckbox != null && transparentCheckbox.getSelection();
        }

        public Color getBackgroundColor() {
            return backgroundColorPicker == null ? null : UIUtils.getSharedTextColors().getColor(backgroundColorPicker.getColorValue());
        }

        public Color getForegroundColorPicker() {
            return foregroundColorPicker == null ? null : UIUtils.getSharedTextColors().getColor(foregroundColorPicker.getColorValue());
        }

        public int getBorderWidth() {
            return borderWidthText == null ? 0 : CommonUtils.toInt(borderWidthText.getText());
        }

        public String getFontData() {
            return fontData;
        }
    }

}


text:
package db_provider

import (
	"testing"

	"github.com/prebid/prebid-server/config"
	"github.com/stretchr/testify/assert"
)

func TestConnStringMySql(t *testing.T) {
	type Params struct {
		db       string
		host     string
		port     int
		username string
		password string
	}

	tests := []struct {
		name       string
		params     Params
		connString string
	}{
		{
			params: Params{
				db: "",
			},
			connString: "tcp()/",
		},
		{
			params: Params{
				db: "TestDB",
			},
			connString: "tcp()/TestDB",
		},
		{
			params: Params{
				host: "example.com",
			},
			connString: "tcp(example.com)/",
		},
		{
			params: Params{
				port: 20,
			},
			connString: "tcp(:20)/",
		},
		{
			params: Params{
				username: "someuser",
			},
			connString: "someuser@tcp()/",
		},
		{
			params: Params{
				username: "someuser",
				password: "somepassword",
			},
			connString: "someuser:somepassword@tcp()/",
		},
		{
			params: Params{
				db:       "TestDB",
				host:     "example.com",
				port:     20,
				username: "someuser",
				password: "somepassword",
			},
			connString: "someuser:somepassword@tcp(example.com:20)/TestDB",
		},
	}

	for _, test := range tests {
		cfg := config.DatabaseConnection{
			Database: test.params.db,
			Host:     test.params.host,
			Port:     test.params.port,
			Username: test.params.username,
			Password: test.params.password,
		}

		provider := MySqlDbProvider{
			cfg: cfg,
		}

		connString := provider.ConnString()
		assert.Equal(t, test.connString, connString, "Strings did not match")
	}
}


text:
package org.apache.ignite.ml.selection.scoring.metric.classification;

import java.io.Serializable;
import org.apache.ignite.ml.selection.scoring.evaluator.aggregator.BinaryClassificationPointwiseMetricStatsAggregator;
import org.apache.ignite.ml.selection.scoring.metric.MetricName;

/**
 * NPV metric class.
 */
public class Npv<L extends Serializable> extends BinaryClassificationMetric<L> {
    /**
     * Serial version uid.
     */
    private static final long serialVersionUID = -2974485980038821226L;

    /**
     * Metric value.
     */
    private Double value = Double.NaN;

    /**
     * Creates an instance of Npv class.
     */
    public Npv() {
    }

    /**
     * Creates an instance of TruePositiveAbsoluteValue class.
     *
     * @param truthLabel Truth label.
     * @param falseLabel False label.
     */
    public Npv(L truthLabel, L falseLabel) {
        super(truthLabel, falseLabel);
    }

    /**
     * {@inheritDoc}
     */
    @Override public Npv<L> initBy(BinaryClassificationPointwiseMetricStatsAggregator<L> aggr) {
        int negativePredictions = aggr.getFalseNegative() + aggr.getTrueNegative();
        value = negativePredictions == 0 ? 1 : (double)aggr.getTrueNegative() / negativePredictions;
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override public double value() {
        return value;
    }

    /**
     * {@inheritDoc}
     */
    @Override public MetricName name() {
        return MetricName.NPV;
    }
}


text:
/*
 * To change this templae, choose Tools | Templates
 * and open the template in the editor.
 */
package utils;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.management.*;
import java.net.HttpURLConnection;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jdom.*;
import eu.cloud4soa.adapter.rest.response.model.Metric;
import java.io.StringReader;
import org.jdom.input.SAXBuilder;

/**
 *
 * @author jled
 */
public class VmMonitoring {

    public static void main(String[] args) {
        VmMonitoring vm = new VmMonitoring();
        try {
            //Metric res[]= vm.getMetricsFromApp();
            //System.out.println("res:"+res[1].toString());
            //Element returnMonitoringInfo = vm.returnMonitoringInfo();
            //System.out.println("vm metrics:"+returnMonitoringInfo.getChild("threads").getAttributeValue("opsys-name"));
            //vm.pingICMP();
            //vm.pingForResponse();
        } catch (Exception ex) {
            Logger.getLogger(VmMonitoring.class.getName()).log(Level.SEVERE, null, ex);
        }

    }

    private String adapterUrl;

    public VmMonitoring() {
    }

    public VmMonitoring(String adapterUrl) {
        this.adapterUrl = adapterUrl;
    }

    public Element returnMonitoringInfo() throws Exception {
        Element elementReturn = null;
        try {
            System.out.println("MXBeanServlet invoked...");
            Element root = new Element("management-info");
            // Get class loading info
            ClassLoadingMXBean clBean = ManagementFactory.getClassLoadingMXBean();

            // Get MbeanServer info
            //MBeanServer platform=ManagementFactory.getPlatformMBeanServer();
            //MBeanInfo mBeanInfo = platform.getMBeanInfo(ObjectName.WILDCARD);
            // Get memory info
            MemoryMXBean memusage = ManagementFactory.getMemoryMXBean();
            // Get runtime information
            RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
            // Get operating system info
            OperatingSystemMXBean operatingSys = ManagementFactory.getOperatingSystemMXBean();
            // Garbage Collection
            List<GarbageCollectorMXBean> garbageCollectorMXBeans = ManagementFactory.getGarbageCollectorMXBeans();
            // Handle thread info
            ThreadMXBean threads = ManagementFactory.getThreadMXBean();
            Element threadsElement = new Element("threads");
            threadsElement.setAttribute("thread-count", Long.toString(threads.getThreadCount()));
            threadsElement.setAttribute("total-started-thread-count", Long.toString(threads.getTotalStartedThreadCount()));
            threadsElement.setAttribute("daemon-thread-count", Long.toString(threads.getDaemonThreadCount()));
            threadsElement.setAttribute("peak-thread-count", Long.toString(threads.getPeakThreadCount()));
            long totalCpuTime = 0l;
            long totalUserTime = 0l;

            // Parse each thread
            ThreadInfo[] threadInfos = threads.getThreadInfo(threads.getAllThreadIds());
            for (int i = 0; i < threadInfos.length; i++) {
                Element threadElement = new Element("thread");
                threadElement.setAttribute("id", Long.toString(threadInfos[ i].getThreadId()));
                threadElement.setAttribute("name", threadInfos[ i].getThreadName());
                threadElement.setAttribute("cpu-time-nano", Long.toString(threads.getThreadCpuTime(threadInfos[ i].getThreadId())));
                threadElement.setAttribute("cpu-time-ms", Long.toString(threads.getThreadCpuTime(threadInfos[ i].getThreadId()) / 1000000l));
                threadElement.setAttribute("user-time-nano", Long.toString(threads.getThreadUserTime(threadInfos[ i].getThreadId())));
                threadElement.setAttribute("user-time-ms", Long.toString(threads.getThreadUserTime(threadInfos[ i].getThreadId()) / 1000000l));
                threadElement.setAttribute("blocked-count", Long.toString(threadInfos[ i].getBlockedCount()));
                threadElement.setAttribute("blocked-time", Long.toString(threadInfos[ i].getBlockedTime()));
                threadElement.setAttribute("waited-count", Long.toString(threadInfos[ i].getWaitedCount()));
                threadElement.setAttribute("waited-time", Long.toString(threadInfos[ i].getWaitedTime()));
                threadsElement.addContent(threadElement);

                // Update our aggregate values
                totalCpuTime += threads.getThreadCpuTime(threadInfos[ i].getThreadId());
                totalUserTime += threads.getThreadUserTime(threadInfos[ i].getThreadId());
            }
            long totalCpuTimeMs = totalCpuTime / 1000000l;
            long totalUserTimeMs = totalUserTime / 1000000l;
            threadsElement.setAttribute("total-cpu-time-nano", Long.toString(totalCpuTime));
            threadsElement.setAttribute("total-user-time-nano", Long.toString(totalUserTime));
            threadsElement.setAttribute("total-cpu-time-ms", Long.toString(totalCpuTimeMs));
            threadsElement.setAttribute("total-user-time-ms", Long.toString(totalUserTimeMs));
            //root.addContent( threadsElement );
            // Memory Usage Info
            MemoryUsage heapMemoryUsage = memusage.getHeapMemoryUsage();
            MemoryUsage nonHeapMemoryUsage = memusage.getNonHeapMemoryUsage();
            int objectPendingFinalizationCount = memusage.getObjectPendingFinalizationCount();

            threadsElement.setAttribute("heap-memory-max", Long.toString(heapMemoryUsage.getMax()));
            threadsElement.setAttribute("heap-memory-used", Long.toString(heapMemoryUsage.getUsed()));
            threadsElement.setAttribute("heap-memory-init", Long.toString(heapMemoryUsage.getInit()));
            threadsElement.setAttribute("heap-memory-commited", Long.toString(heapMemoryUsage.getCommitted()));
            threadsElement.setAttribute("nonheap-memory-max", Long.toString(nonHeapMemoryUsage.getMax()));
            threadsElement.setAttribute("nonheap-memory-used", Long.toString(nonHeapMemoryUsage.getUsed()));
            threadsElement.setAttribute("nonheap-memory-init", Long.toString(nonHeapMemoryUsage.getInit()));
            threadsElement.setAttribute("nonheap-memory-commited", Long.toString(nonHeapMemoryUsage.getCommitted()));
            threadsElement.setAttribute("memory-object-pending-finalization", Integer.toString(objectPendingFinalizationCount));

            // Operating System
            String name = operatingSys.getName();
            String version = operatingSys.getVersion();
            String arch = operatingSys.getArch();
            int availableProcessors = operatingSys.getAvailableProcessors();
            double systemLoadAverage = operatingSys.getSystemLoadAverage();

            threadsElement.setAttribute("opsys-name", name);
            threadsElement.setAttribute("opsys-version", version);
            threadsElement.setAttribute("opsys-arch", arch);
            threadsElement.setAttribute("opsys-available-processors", Integer.toString(availableProcessors));
            threadsElement.setAttribute("opsys-system-load-avg", Double.toString(systemLoadAverage));

            threadsElement.setAttribute("garbage-collector-mbeans-size", Integer.toString(garbageCollectorMXBeans.size()));

            // Compute thread percentages
            long uptime = runtime.getUptime();
            threadsElement.setAttribute("uptime", Long.toString(uptime));
            double cpuPercentage = ((double) totalCpuTimeMs / (double) uptime) * 100.0;
            double userPercentage = ((double) totalUserTimeMs / (double) uptime) * 100.0;
            threadsElement.setAttribute("total-cpu-percent", Double.toString(cpuPercentage));
            threadsElement.setAttribute("total-user-percent", Double.toString(userPercentage));
            threadsElement.setAttribute("loaded-class-count", Integer.toString(clBean.getLoadedClassCount()));
            threadsElement.setAttribute("total-loaded-class-count", Long.toString(clBean.getTotalLoadedClassCount()));
            threadsElement.setAttribute("unloaded-class-count", Long.toString(clBean.getUnloadedClassCount()));

            root.addContent(threadsElement);

            // Output the XML to the caller
            //XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
            //XMLOutputter outputter = new XMLOutputter( "\t", true );
            //outputter.output( root, res.getOutputStream() );
            //System.out.println("element:"+threadsElement.getAttributeValue("opsys-name"));
            //System.out.println("XML:"+root.getChild("threads").getAttributeValue("opsys-name"));
            elementReturn = root;
        } catch (Exception e) {
            e.printStackTrace();
            throw new Exception(e);
        }
        return elementReturn;
    }

    public long pingICMP() {
        String host = "localhost";
        int timeOut = 5000;
        long pingTime = 0L;
        try {

            long currentTime = System.nanoTime();
            boolean isPinged = InetAddress.getByName(host).isReachable(timeOut);
            pingTime = System.nanoTime() - currentTime;
            if (isPinged) {
                System.out.println("pinged successfully in " + pingTime + "nanoseconds");
                System.out.println("pinged successfully in " + pingTime / 1000 + "microseconds");
                System.out.println("pinged successfully in " + pingTime / 1000000 + "milliseconds");
            } else {
                System.out.println("PIng failed.");
            }
        } catch (IOException ex) {
            Logger.getLogger(VmMonitoring.class.getName()).log(Level.SEVERE, null, ex);
        }
        return pingTime;
    }

    public long pingForResponse() {
        HttpURLConnection connection = null;
        long pingTime = 0L;
        try {
            long currentTime = System.nanoTime();

            URL u = new URL("http://" + adapterUrl);
            connection = (HttpURLConnection) u.openConnection();
            connection.setRequestMethod("HEAD");
            int code = connection.getResponseCode();
            pingTime = System.nanoTime() - currentTime;
            //connection.get
            System.out.println("" + code);
            System.out.println("pinged successfully in " + pingTime + "nanoseconds");
            System.out.println("pinged successfully in " + pingTime / 1000 + "microseconds");
            System.out.println("pinged successfully in " + pingTime / 1000000 + "milliseconds");

            // You can determine on HTTP return code received. 200 is success.
        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (connection != null) {
                connection.disconnect();
            }
        }
        return pingTime;
    }

    public int checkAppMetricsAvailability(String url) {
        HttpURLConnection connection = null;
        int code;
        try {
            URL u = new URL("http://" + url + "/c4smtrex");
            connection = (HttpURLConnection) u.openConnection();
            // connection.setRequestMethod("HEAD");
            code = connection.getResponseCode();
        } catch (Exception ex) {
            Logger.getLogger(VmMonitoring.class.getName()).log(Level.SEVERE, null, ex);
            code = 404;
        }
        return code;
    }

    public Metric[] getMetricsFromApp(String url) {
        HttpURLConnection connection = null;
        String inputLine = null;
        Metric[] metrics = new Metric[4];
        try {
            URL u = new URL("http://"+url+"/c4smtrex/"+"?appurl="+url);
            //URLConnection yc = u.openConnection();
            connection = (HttpURLConnection) u.openConnection();
            // connection.setRequestMethod("HEAD");
            int code = connection.getResponseCode();
            if (code == 200) {
                BufferedReader in = new BufferedReader(
                        new InputStreamReader(
                        connection.getInputStream()));

                StringBuilder response = new StringBuilder();

                while ((inputLine = in.readLine()) != null) {
                    response.append(inputLine);
                }
                in.close();
                inputLine = response.toString();

                SAXBuilder builder = new SAXBuilder();
                try {
                    org.jdom.Document doc = builder.build(new StringReader(inputLine));
                    Element metricsElement = doc.getRootElement().getChild("metrics");

                    Metric cpuMetric = new Metric();
                    cpuMetric.setMetricName("CPU_Load");
                    cpuMetric.setValue(metricsElement.getAttributeValue("CPU_Load"));
                    Metric memMetric = new Metric();
                    memMetric.setMetricName("Memory_Load");
                    memMetric.setValue(metricsElement.getAttributeValue("Memory_Load"));
                    Metric cloudMetric = new Metric();
                    cloudMetric.setMetricName("CloudResponseTime");
                    cloudMetric.setValue(metricsElement.getAttributeValue("CloudResponseTime"));
                    Metric containerMetric = new Metric();
                    containerMetric.setMetricName("ContainerResponseTime");
                    containerMetric.setValue(metricsElement.getAttributeValue("ContainerResponseTime"));

                    metrics[0] = cpuMetric;
                    metrics[1] = memMetric;
                    metrics[2] = cloudMetric;
                    metrics[3] = containerMetric;
                    //ret.setMetrics(metrics);
                } catch (JDOMException e) {
                    // handle JDOMException
                } catch (IOException e) {
                    // handle IOException
                }

            }
            // You can determine on HTTP return code received. 200 is success.
        } catch (MalformedURLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } finally {
            if (connection != null) {
                connection.disconnect();
            }
        }
        return metrics;
    }

}


text:
package atomic

import (
	"testing"
	"time"

	"k8s.io/kubernetes/pkg/util/wait"
)

func ExpectValue(t *testing.T, atomicValue *Value, expectedValue interface{}) {
	actualValue := atomicValue.Load()
	if actualValue != expectedValue {
		t.Errorf("Expected to find %v, found %v", expectedValue, actualValue)
	}
	ch := make(chan interface{})
	go func() {
		ch <- atomicValue.Load()
	}()
	select {
	case actualValue = <-ch:
		if actualValue != expectedValue {
			t.Errorf("Expected to find %v, found %v", expectedValue, actualValue)
			return
		}
	case <-time.After(wait.ForeverTestTimeout):
		t.Error("Value could not be read")
		return
	}
}

func TestAtomicValue(t *testing.T) {
	atomicValue := &Value{}
	ExpectValue(t, atomicValue, nil)
	atomicValue.Store(10)
	ExpectValue(t, atomicValue, 10)
}


text:
<!DOCTYPE html>

<meta charset="UTF-8"/>
<link href="default.css" rel="stylesheet" type="text/css" />

この<ruby>店<rt>みせ</rt></ruby>
も
 ほぼ <ruby>旅<rt>たび</rt></ruby>
の
<ruby>魔<rt>ま</rt></ruby><ruby>導<rt>しるべ</rt></ruby><ruby>士<rt>し</rt></ruby> <ruby>専門<rt>せんもん</rt></ruby>です
わ
。

This store is mainly for traveling mages.


text:
[![Latest release](http://img.shields.io/github/release/patrikhuber/eos.svg?style=flat-square)][release]
[![Linux build status of master branch](https://img.shields.io/travis/patrikhuber/eos/master.svg?style=flat-square&label=Linux%3A%20build)][travis]
[![Windows build status of master branch](https://ci.appveyor.com/api/projects/status/gekekpn08cdgqcsk/branch/master?svg=true&passingText=Windows%3A%20build%20passing&failingText=Windows%3A%20build%20failing&pendingText=Windows%3A%20build%20pending)][appveyor]
[![Apache License 2.0](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat-square)][license]

[release]: https://github.com/patrikhuber/eos/releases
[travis]: https://travis-ci.org/patrikhuber/eos
[appveyor]: https://ci.appveyor.com/project/patrikhuber/eos/branch/master
[license]: https://github.com/patrikhuber/eos/blob/master/LICENSE

eos is a lightweight 3D Morphable Face Model fitting library that provides basic functionality to use face models, as well as camera and shape fitting functionality. It's written in modern C++11/14.

At the moment, it mainly provides the following functionality:

* MorphableModel and PcaModel classes to represent 3DMMs, with basic operations like `draw_sample()`
* Our low-resolution, shape-only 3D Morphable Face Model ([share/sfm_shape_3448.bin](https://github.com/patrikhuber/eos/blob/master/share/sfm_shape_3448.bin))
* Fast, linear pose, shape and expression fitting, edge and contour fitting:
  * Linear scaled orthographic projection camera pose estimation
  * Linear shape-to-landmarks fitting, implementation of O. Aldrian & W. Smith, _Inverse Rendering of Faces with a 3D Morphable Model_, PAMI 2013
  * Expression fitting, and 6 linear expression blendshapes: anger, disgust, fear, happiness, sadness, surprise
  * Edge-fitting, heavily inspired by: A. Bas et al., _Fitting a 3D Morphable Model to Edges: A Comparison Between Hard and Soft Correspondences_, ACCVW 2016
* Isomap texture extraction to obtain a pose-invariant representation of the face texture
* (**New**): Python bindings for parts of the library, and Matlab bindings for the fitting
* (_Experimental_): Non-linear fitting cost functions using Ceres for shape, camera, blendshapes and the colour model (needs Ceres to be installed separately)

## Usage

* Tested with the following compilers: >=gcc-4.9, >=clang-3.5, Visual Studio 2015
* Needed dependencies for the library: Boost system (>=1.50.0), OpenCV core (>=2.4.3)

To use the library in your own project, just add the following directories to your include path:

* `eos/include`
* `eos/3rdparty/cereal/include`
* `eos/3rdparty/glm`
* `eos/3rdparty/nanoflann/include`
* `eos/3rdparty/eigen/Eigen`
* `eos/3rdparty/eigen3-nnls/src`

**Make sure to clone with `--recursive` to download the required submodules!**

### Build the examples and tests

* Needed dependencies for the example app: CMake (>=3.1.3), Boost system, filesystem, program_options (>=1.50.0), OpenCV core, imgproc, highgui (>=2.4.3).

To build:

```
git clone --recursive https://github.com/patrikhuber/eos.git
mkdir build && cd build # creates a build directory next to the 'eos' folder
cmake -G "<your favourite generator>" ../eos -DCMAKE_INSTALL_PREFIX=../install/
make && make install # or open the project file and build in an IDE like Visual Studio
```
If some dependencies can't be found, copy `initial_cache.cmake.template` to `initial_cache.cmake`, edit the necessary paths and run `cmake` with `-C ../eos/initial_cache.cmake`. On Linux, you may also want to set `-DCMAKE_BUILD_TYPE=...` appropriately.

## Sample code

The fit-model example app creates a 3D face from a 2D image.

After `make install` or running the `INSTALL` target, an example image with landmarks can be found in `install/bin/data/`. The model and the necessary landmarks mapping file are installed to `install/share/`.

You can run the example just by running:

`fit-model`

It will load the face model, landmark-to-vertex mappings, blendshapes, and other required files from the `../share/` directory, and run on the example image. It can be run on other images by giving it a `-i` parameter for the image and `-l` for a set of ibug landmarks. The full set of parameters can be viewed by running `fit-model --help`.

If you are just getting started, it is recommended to have a look at `fit-model-simple` too, as it requires much fewer input, and only fits pose and shape, without any blendshapes or edge-fitting. Its full set of arguments is:

`fit-model-simple -m ../share/sfm_shape_3448.bin -p ../share/ibug2did.txt -i data/image_0010.png -l data/image_0010.pts`

The output in both cases is an `obj` file with the shape and a `png` with the extracted isomap. The estimated pose angles and shape coefficients are available in the code via the API.

See [examples/fit-model.cpp](https://github.com/patrikhuber/eos/blob/master/examples/fit-model.cpp) for the full code.

## The Surrey Face Model

The library includes a low-resolution shape-only version of the Surrey Morphable Face Model. It is a PCA model of shape variation built from 3D face scans. It comes with uv-coordinates to perform texture remapping.

The full model is available at [http://www.cvssp.org/facemodel](http://www.cvssp.org/facemodel).

## Python bindings

eos includes python bindings for some of its functionality (and more can be added!). An experimental package is on PyPI: Try `pip install eos-py`. You will still need the data files from this repository.
In case of issues, build the bindings manually: Clone the repository and set `-DEOS_GENERATE_PYTHON_BINDINGS=on` when running `cmake` (and optionally set `PYTHON_EXECUTABLE` to point to your python interpreter if it's not found automatically).

After having obtained the bindings, they can be used like any python module:

```
import eos
import numpy as np

model = eos.morphablemodel.load_model("eos/share/sfm_shape_3448.bin")
sample = model.get_shape_model().draw_sample([1.0, -0.5, 0.7])

help(eos) # check the documentation
```

See [`demo.py`](https://github.com/patrikhuber/eos/blob/master/python/demo.py) for an example on how to run the fitting.

## Matlab bindings

_Experimental_: eos includes Matlab bindings for the `fit_shape_and_pose(...)` function, which means the fitting can be run from Matlab. Set `-DEOS_GENERATE_MATLAB_BINDINGS=on` when running `cmake` to build the required mex-file and run the `INSTALL` target to install everything. (Set `Matlab_ROOT_DIR` to point to your Matlab directory if it's not found automatically). More bindings (e.g. the MorphableModel itself) might be added in the future.

Go to the `install/eos/matlab` directory and run [`demo.m`](https://github.com/patrikhuber/eos/blob/master/matlab/demo.m) to see how to run the fitting. The result is a mesh and rendering parameters (pose).

## Documentation

Doxygen: http://patrikhuber.github.io/eos/doc/

The [fit-model example](https://github.com/patrikhuber/eos/blob/master/examples/fit-model.cpp) and the [Namespace List](http://patrikhuber.github.io/eos/doc/namespaces.html) in doxygen are a good place to start.

## License & contributions

This code is licensed under the Apache License, Version 2.0. The 3D morphable face model under [share/sfm_shape_3448.bin](https://github.com/patrikhuber/eos/blob/master/share/sfm_shape_3448.bin) is free for use for non-commercial purposes. For commercial purposes and to obtain other model resolutions, see [http://www.cvssp.org/facemodel](http://www.cvssp.org/facemodel).

Contributions are very welcome! (best in the form of pull requests.) Please use GitHub issues for any bug reports, ideas, and discussions.

If you use this code in your own work, please cite the following paper: _A Multiresolution 3D Morphable Face Model and Fitting Framework_, P. Huber, G. Hu, R. Tena, P. Mortazavian, W. Koppen, W. Christmas, M. Rätsch, J. Kittler, International Conference on Computer Vision Theory and Applications (VISAPP) 2016, Rome, Italy [[PDF]](http://www.patrikhuber.ch/files/3DMM_Framework_VISAPP_2016.pdf).


text:
<?php if ( ! defined('SZ_EXEC') ) exit('access_denied');

class BtHtmlcontentActiveRecord extends SZ_ActiveRecord
{
	protected $_table   = 'bt_htmlcontent';
	protected $_primary = 'block_id';
	protected $_schemas = array(
		'block_id' => array('type' => 'INT'),
		'body' => array('type' => 'TEXT')
	);

	public function isValidBlockId($value) {
		return TRUE;
	}

	public function isValidBody($value) {
		return TRUE;
	}

}