Skip to content

Commit 8023ff1

Browse files
committed
Revert "removed unnecessary TODO; enriched one koan"
This reverts commit 609e479.
1 parent 5856f75 commit 8023ff1

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎koans/src/beginner/AboutObjects.java‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class Foo {
2929
@Koan
3030
public void objectToString() {
3131
Object object = new Object();
32+
// TODO: Why is it best practice to ALWAYS override toString?
3233
String expectedToString = MessageFormat.format("{0}@{1}", Object.class.getName(), Integer.toHexString(object.hashCode()));
3334
assertEquals(expectedToString, __); // hint: object.toString()
3435
}
@@ -48,9 +49,7 @@ public String toString() {
4849
@Koan
4950
public void toStringIsTestedForNullWhenInvokedImplicitly() {
5051
String string = "string";
51-
Integer i = new Integer(128);
52-
Short s = new Short((short) 15);
53-
assertEquals(string + " " + i + " " + s, __);
52+
assertEquals(string + null, __);
5453
}
5554

5655
private Class<?>[] getAncestors(Object object) {

0 commit comments

Comments
 (0)