Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 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;
 }