if (sendC) { C myC = new C(); myC.setA(A_TEXT); return myC; } else { B myB = new B(); myB.setB(B_TEXT); myB.setA(A_TEXT); return myB; }