### Question:
ThreadScope extends BaseScope { @Override public <T> Provider<T> scope(final Key<T> key, final Provider<T> unscoped) { return new Provider<T>() { @Override public T get() { Map<Key<?>, Object> map = getScopeMapForCurrentThread(); checkState(map != null, "No scope map found for the current thread. Forgot to call enterScope()?"); return getScopedObject(key, unscoped, map); } @Override public String toString() { return String.format("%s[%s]", unscoped, ThreadScope.this); } }; }  @Override Provider<T> scope(final Key<T> key, final Provider<T> unscoped); @Override void enterScope(); void enterScopeNonInheritable(); boolean isScopeEntered(); @Override void exitScope();  }### Answer:
@Test public void testToString() { ThreadScope scope = new ThreadScope(); Provider<String> prov = scope.scope(Key.get(String.class), new Provider<String>() { @Override public String get() { return "dummy"; } @Override public String toString() { return get(); } }); Assert.assertEquals(prov.toString(), "dummy[ThreadScope]"); }