@Test public void toString_NullWhenLeftIsNull() { Pair<Command, Integer> pair = new Pair<Command, Integer>(null, 0); assertEquals("(NULL, 0)", pair.toString()); }
@Override public String toString() { return "(" + (left == null ? "NULL" : left.toString()) + ", " + (right == null ? "NULL" : right.toString()) + ")"; }
Pair { @Override public String toString() { return "(" + (left == null ? "NULL" : left.toString()) + ", " + (right == null ? "NULL" : right.toString()) + ")"; } }
Pair { @Override public String toString() { return "(" + (left == null ? "NULL" : left.toString()) + ", " + (right == null ? "NULL" : right.toString()) + ")"; } Pair(T left, U right); }
Pair { @Override public String toString() { return "(" + (left == null ? "NULL" : left.toString()) + ", " + (right == null ? "NULL" : right.toString()) + ")"; } Pair(T left, U right); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); }
Pair { @Override public String toString() { return "(" + (left == null ? "NULL" : left.toString()) + ", " + (right == null ? "NULL" : right.toString()) + ")"; } Pair(T left, U right); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); public T left; public U right; }