public Collection<LocalSession> getLocalSessions() {
        return List.copyOf(localSessionCache.values());
    }
@Test
    public void require_that_new_invalid_application_throws_exception() throws Exception {
        MockModelFactory failingFactory = new MockModelFactory();
        failingFactory.vespaVersion = new Version(1, 2, 0);
        failingFactory.throwOnLoad = true;

        MockModelFactory okFactory = new MockModelFactory();
        okFactory.vespaVersion = new Version(1, 1, 0);
        okFactory.throwOnLoad = false;

        setup(new ModelFactoryRegistry(List.of(okFactory, failingFactory)));

        Collection<LocalSession> sessions = sessionRepository.getLocalSessions();
        try {
            deploy();
            fail("deployment should have failed");
        } catch (InvalidApplicationException e) {
            assertEquals(sessions, sessionRepository.getLocalSessions());
        }
    }