### Question:
ImmutableElectricObject { public Variable[] toVariableArray() { return vars.length == 0 ? vars : (Variable[]) vars.clone(); } 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 testToVariableArray() { System.out.println("toVariableArray"); Variable[] vars2 = obj_Aa.toVariableArray(); assertNotSame(Aa, vars2); assertEquals(2, vars2.length); assertSame(Aa[0], vars2[0]); assertSame(Aa[1], vars2[1]); }