title: merging one object into another object
body: <p>I have two Objects of same type.I want to create a method which can merge the properties of two object and can return a single object.</p>
  
  <p>For Example:
  Consider a class ABC having 4 fields</p>
  
  <pre><code>Class ABC{
  String name;
  String id;
  String salary;
  String status;
  }
  </code></pre>
  
  <p>Suppose the first object is </p>
  
  <pre><code>ABC[name=ZEE,id=2,salary=null,status=1]
  </code></pre>
  
  <p>and the second object is </p>
  
  <pre><code>ABC[name=john,id=null,salary=12200,status=null]
  </code></pre>
  
  <p>I want to make a generic method which can merge these two objects and can give result output as:</p>
  
  <pre><code>ABC[name=ZEE,id=2,salary=12200,status=1]
  </code></pre>
  
  <p>The method Should take two parameters of Object type:</p>
  
  <pre><code>Object  mergeObject(Object Obj1, Object Obj2){
  }
  </code></pre>
  
  <p>Note: It will take the first object property if both the objects have non-null value for that property.</p>