### Question:
ImmutableElectricObject { public Iterator<Variable> getVariables() { return ArrayIterator.iterator(vars); } 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 testGetVariables() { System.out.println("getVariables"); Iterator<Variable> it0 = obj0.getVariables(); assertTrue(!it0.hasNext()); Iterator<Variable> it = obj_Aa.getVariables(); assertSame(ATTR_A_F, it.next()); assertSame(a_foo, it.next()); assertTrue(!it.hasNext()); }
@Test(expected = UnsupportedOperationException.class) public void testGetVariablesRemove() { System.out.println("getVariablesRemove"); Iterator<Variable> it = obj_Aa.getVariables(); assertSame(ATTR_A_F, it.next()); it.remove(); }