Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active February 29, 2024 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcsee/20c94ec159e6333ddd5891b4af0d5688 to your computer and use it in GitHub Desktop.
Save mcsee/20c94ec159e6333ddd5891b4af0d5688 to your computer and use it in GitHub Desktop.
public abstract class SetTest {
protected abstract Set<String> constructor();
@Test
public final void testAddEmpty() {
Set<String> s = this.constructor();
s.add("green");
s.add("blue");
assertEquals("{green. blue}", s.toString());
// This is fragile
// since it depends on set sort (which is not defined)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment