### Question:
ImmutableElectricObject { Variable[] arrayWithVariable(Variable var) { return arrayWithVariable(vars, var); } ImmutableElectricObject(Variable[] vars, int flags); Variable getVar(Variable.Key key); T getVarValue(Variable.Key key, Class type); Iterator<Variable> getVariables(); Variable[] toVariableArray(); int getNumVariables(); Variable getVar(int varIndex); int searchVar(Variable.Key key); abstract int hashCodeExceptVariables(); abstract boolean equalsExceptVariables(ImmutableElectricObject o); boolean equalsVariables(ImmutableElectricObject o); final int flags; }### Answer:
@Test public void testArrayWithVariable() { System.out.println("arrayWithVariable"); assertSame(obj_a.getVars(), obj_a.arrayWithVariable(a_foo)); Variable[] vars2 = obj_a.arrayWithVariable(ATTR_A_F); assertEquals(2, vars2.length); assertSame(ATTR_A_F, vars2[0]); assertSame(a_foo, vars2[1]); Variable[] vars3 = obj_Aa.arrayWithVariable(B_F); assertEquals(3, vars3.length); assertSame(ATTR_A_F, vars3[0]); assertSame(B_F, vars3[1]); assertSame(a_foo, vars3[2]); }