Toothpick { public static Scope openScopes(Object... names) { if (names == null) { throw new IllegalArgumentException("null scope names are not allowed."); } if (names.length == 0) { throw new IllegalArgumentException("Minimally, one scope name is required."); } ScopeNode lastScope = null; ScopeNode previousScope = (ScopeNode) openScope(names[0], true); for (int i = 1; i < names.length; i++) { lastScope = (ScopeNode) openScope(names[i], false); lastScope = previousScope.addChild(lastScope); previousScope = lastScope; } return previousScope; } 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 openScopes_shouldFail_whenScopeNamesAreNull() { Toothpick.openScopes((Object[]) null); }
@Test(expected = IllegalArgumentException.class) public void openScopes_shouldFail_whenScopeNamesAreEmpty() { Toothpick.openScopes(new Object[0]); }