private void assertBounded(SortedSet<String> deserialized,boolean bounded){
  if (bounded) {
    try {
      deserialized.add("e");
      fail();
    }
 catch (    IllegalArgumentException expected) {
    }
  }
 else {
    assertTrue(deserialized.add("e"));
    assertTrue(deserialized.remove("e"));
  }
}

private void assertBounded ( SortedSet < String > deserialized , boolean bounded ) { if ( bounded ) { try { deserialized . add ( "e" ) ; fail ( ) ; } catch ( IllegalArgumentException expected ) { } } else { assertTrue ( deserialized . add ( "e" ) ) ; assertTrue ( deserialized . remove ( "e" ) ) ; } }
regrettably , serializing a treeset causes it to forget its bounds . this is unlike a serialized treemap which retains its bounds when serialized .
