SortOrder { @Override public String toString() { return field + (descending ? "descending" : "ascending"); } SortOrder(String field);  SortOrder(String field, boolean descending); String getField(); boolean isDescending(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }
@Test public void testToString_1() throws Exception { SortOrder fixture = new SortOrder("", false); String result = fixture.toString(); assertEquals("ascending", result); }
@Test public void testToString_2() throws Exception { SortOrder fixture = new SortOrder("", true); String result = fixture.toString(); assertEquals("descending", result); }