Skip to content

Instantly share code, notes, and snippets.

@tadams
Last active August 29, 2015 14:05
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 tadams/7da852cad9431db2c0cf to your computer and use it in GitHub Desktop.
Save tadams/7da852cad9431db2c0cf to your computer and use it in GitHub Desktop.
public class Zombie implements Compares<Zombie>
... remainder of Zombie code is unchanged
public class Zombie2Test {
Zombie walker = new Zombie(WALKER);
Zombie fatty = new Zombie(FATTY);
@Test
public void shouldUseCompareMethods() {
assertTrue(walker.isLessThan(fatty));
assertTrue(fatty.isGreaterThan(walker));
assertTrue(fatty.isEqual(fatty));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment