Toothpick { public static boolean isScopeOpen(Object name) { if (name == null) { throw new IllegalArgumentException("null scope names are not allowed."); } return MAP_KEY_TO_SCOPE.containsKey(name); } protected  Toothpick(); static Scope openRootScope(); static Scope openRootScope(ScopeConfig scopeConfig); static boolean isRootScopeOpen(); static boolean isScopeOpen(Object name); static Scope openScopes(Object... names); static Scope openScope(Object name); static Scope openScope(Object name, ScopeConfig scopeConfig); static void closeScope(Object name); static void reset(); static void reset(Scope scope); static void release(Scope scope); static void inject(Object obj, Scope scope); static void setConfiguration(Configuration configuration);  }
@Test(expected = IllegalArgumentException.class) public void isScopeOpen_shouldThrowException_WhenNameIsNull() { Toothpick.isScopeOpen(null); fail("Should throw an exception"); }
@Test public void isScopeOpen_shouldReturnFalse_WhenThisScopesWasNotCreated() { boolean isFooScopeOpen = Toothpick.isScopeOpen("foo"); assertThat(isFooScopeOpen, is(false)); }