private static int testToString2() { int errors = 0; String s = "not the default"; errors += (s.equals(Objects.toString(null, s))) ? 0 : 1; errors += (s.equals(Objects.toString(s, "another string"))) ? 0 : 1; return errors; }
private static int testToString() { int errors = 0; errors += ("null".equals(Objects.toString(null))) ? 0 : 1; String s = "Some string"; errors += (s.equals(Objects.toString(s))) ? 0 : 1; return errors; }