    @Test
    public void testInScope() throws Exception {

        final int limit = 10;
        StringBuilder constant = new StringBuilder("hello");
        final boolean[] ran = new boolean[1];
        //Recursively enter the scope multiple times, and ensure that the
        //most recent values are the ones which are available
        class One implements ThrowingFunction<Integer, Void> {

            @Override
            public Void apply(Integer argument) throws Exception {
                ran[0] = true;
                assertNotNull(dependencies.getInstance(Integer.class));
                assertEquals(argument, dependencies.getInstance(Integer.class));
                assertNotNull(dependencies.getInstance(String.class));
                assertEquals(argument.toString(), dependencies.getInstance(String.class));
                assertNotNull(dependencies.getInstance(StringBuilder.class));
                assertEquals("hello", dependencies.getInstance(StringBuilder.class).toString());
                int next = argument + 1;
                if (next < limit) {
                    dependencies.getInstance(AbstractScope.class)
                            .run(this, next, Integer.valueOf(next), Integer.toString(next));
                }
                return null;
            }
        }
        assertTrue(dependencies.getInstance(AbstractScope.class) instanceof ReentrantScope);
        dependencies.getInstance(AbstractScope.class).run(new One(), 1, constant, Integer.valueOf(1), Integer.toString(1));
        assertTrue("Invokable was not run", ran[0]);
    }