### Question:
StringSequence extends BaseSequence { @Override public String getValue (String name) { checkName (name); if (mIter == null) { mIter = mList.iterator (); } if (mIter.hasNext ()) { return mIter.next (); } else { throw new ExecutionException ("all strings have been used"); } } StringSequence(String name, Scope scope); @Override String getValue(String name);  }### Answer:
@Test (expected=ExecutionException.class) public void testGetValueEmptyWithName () { mSequence.getValue (NAME); }
@Test (expected=ExecutionException.class) public void testGetValueEmptyWithoutName () { mSequence.getValue (); }
@Test (expected=ExecutionException.class) public void testGetValueOneValueWithName () { mSequence.setValue (NAME, VALUE1); assertEquals (VALUE1, mSequence.getValue (NAME)); mSequence.getValue (NAME); }
@Test (expected=ExecutionException.class) public void testGetValueOneValueWithoutName () { mSequence.setValue (VALUE1); assertEquals (VALUE1, mSequence.getValue ()); mSequence.getValue (); }
@Test (expected=ExecutionException.class) public void testGetValueTwoValuesWithName () { mSequence.setValue (NAME, VALUE1); mSequence.setValue (NAME, VALUE2); assertEquals (VALUE1, mSequence.getValue (NAME)); assertEquals (VALUE2, mSequence.getValue (NAME)); mSequence.getValue (NAME); }
@Test (expected=ExecutionException.class) public void testGetValueTwoValuesWithoutName () { mSequence.setValue (VALUE1); mSequence.setValue (VALUE2); assertEquals (VALUE1, mSequence.getValue ()); assertEquals (VALUE2, mSequence.getValue ()); mSequence.getValue (); }
@Test (expected=ExecutionException.class) public void testSetValueAfterUse () { mSequence.setValue (VALUE1); assertEquals (VALUE1, mSequence.getValue (NAME)); mSequence.setValue (VALUE1); }