@Test public void toStringWithNoValueOrDefaultReturnsBlankString() { Result<String> result = new Result<>(); Assert.assertEquals("", result.toString()); }
@Override public String toString() { _lock.readLock().lock(); try { long key = Thread.currentThread().getId(); if (_valueMap.containsKey(key)) { return _valueMap.get(key).toString(); } if (_defaultValue != null) { return _defaultValue.toString(); } return ""; } finally { _lock.readLock().unlock(); } }
Result implements Referable<T> { @Override public String toString() { _lock.readLock().lock(); try { long key = Thread.currentThread().getId(); if (_valueMap.containsKey(key)) { return _valueMap.get(key).toString(); } if (_defaultValue != null) { return _defaultValue.toString(); } return ""; } finally { _lock.readLock().unlock(); } } }
Result implements Referable<T> { @Override public String toString() { _lock.readLock().lock(); try { long key = Thread.currentThread().getId(); if (_valueMap.containsKey(key)) { return _valueMap.get(key).toString(); } if (_defaultValue != null) { return _defaultValue.toString(); } return ""; } finally { _lock.readLock().unlock(); } } Result();  Result(T value); }
Result implements Referable<T> { @Override public String toString() { _lock.readLock().lock(); try { long key = Thread.currentThread().getId(); if (_valueMap.containsKey(key)) { return _valueMap.get(key).toString(); } if (_defaultValue != null) { return _defaultValue.toString(); } return ""; } finally { _lock.readLock().unlock(); } } Result();  Result(T value); void reset(); @Override T getValue(); @Override void setValue(T value); @Override String toString(); }
Result implements Referable<T> { @Override public String toString() { _lock.readLock().lock(); try { long key = Thread.currentThread().getId(); if (_valueMap.containsKey(key)) { return _valueMap.get(key).toString(); } if (_defaultValue != null) { return _defaultValue.toString(); } return ""; } finally { _lock.readLock().unlock(); } } Result();  Result(T value); void reset(); @Override T getValue(); @Override void setValue(T value); @Override String toString();  }