Setting different object with same attributes
<p>This is not the first time that I've found myself in a situation in which I have to adapt two objects with almost the same data, for example:</p>

<pre><code>User.java  (Object returned from another library)
private String name;
private String surname;
private String email;
private String telephone;
...
getters and setters();
constructor();
</code></pre>

<hr>

<pre><code>MyUser.java
private String name;
private String surname;
private String email;
private String telephone;
...
getters and setters();
constructor();
</code></pre>

<p>I usually create a method to convert one object into another one, like this:</p>

<pre><code> User m1 = new User();
 MyUser m2 = new MyUser();
 m2.setName(m1.getName());
 m2.setsurmame(m1.getsurname());
</code></pre>

<p>...and so on...</p>

<p>Does anybody know a different way to do this kind of stuff? </p>
