converter to convert from one class to another
<p>I need an converter to convert from one class to another. Can someone help in completing this   computeA method in class AtoB.</p>

<p>I have class A</p>

<pre><code>/*class A*/
class A
{
    private String x;
    private A y;
    public A(String x, A y) {
        this.x = x;
        this.y = y;
    }
    public String getx() {
        return x;
    }
    public A gety() {
        return y;
    }
}
/*Class B*/
class B
{
    private A x;
    private List&lt;B&gt; y; 
    public A getx() {
        return x;
    }
    public List&lt;B&gt; gety() {
        return y;
    }
    public void setA(A x) {
        this.x = x;
    }
    public void sety(List&lt;B&gt; y) {
        this.y = y;
    }    
}

/*Need a converter from A to B*/

public class AtoB {

    public B computeA(Iterable&lt;A&gt; obj) {
        for (A ob : obj){
            System.out.println(ob);
        }
        return null;
    }
}
</code></pre>

<p>Can someone help in completing this   computeA method in class AtoB,</p>
