public void testReadEmptySet() {
    final String stream = "[1,\"" + HASHSET + "\",1,2,0]";
    final ClientObjectInputStream reader =
        createObjectInputStream(stream, HASHSET, SetReader.instance);
    final Set set = (Set) reader.readObject();
    assertNotNull(set);
    assertEquals("" + set, 0, set.size());

    this.verifyFurtherReadsFail(reader);
  }
  public void testReadSetSingleElement() {
    final String stream = "[2,\"" + HASHSET + "\",\"" + APPLE + "\",1,2,1,3]";
    final ClientObjectInputStream reader =
        createObjectInputStream(stream, HASHSET, SetReader.instance);
    final Set set = (Set) reader.readObject();
    assertNotNull(set);
    assertEquals("" + set, 1, set.size());
    assertEquals("" + set, APPLE, set.iterator().next());

    this.verifyFurtherReadsFail(reader);
  }
  public void testReadSetWithElements() {
    final String stream = "[3,\"" + HASHSET + "\",\"" + APPLE + "\",\"" + BANANA + "\",1,2,2,3,4]";
    final ClientObjectInputStream reader =
        createObjectInputStream(stream, HASHSET, SetReader.instance);
    final Set set = (Set) reader.readObject();
    assertNotNull(set);
    assertEquals("" + set, 2, set.size());

    final Iterator iterator = set.iterator();
    assertEquals("" + set, APPLE, iterator.next());
    assertEquals("" + set, BANANA, iterator.next());

    this.verifyFurtherReadsFail(reader);
  }