public Application build() throws Exception {
            Application app = null;
            Exception exception = null;

            // if we get a bind exception, then retry a few times (may conflict with parallel test runs)
            for (int i = 0; i < 5; i++) {
                try {
                    generateXml();
                    app = new Application(path, networking, true);
                    break;
                } catch (Error e) { // the container thinks this is really serious, in this case is it not in the cause is a BindException
                    // catch bind error and reset container
                    Optional<BindException> bindException = Exceptions.findCause(e, BindException.class);
                    if (bindException.isPresent()) {
                        exception = bindException.get();
                        com.yahoo.container.Container.resetInstance(); // this is needed to be able to recreate the container from config again
                    } else {
                        throw new Exception(e.getCause());
                    }
                }
            }

            if (app == null) {
                throw exception;
            }
            return app;
        }
@param networking enable or disable networking (disabled by default)
@return builder
application/src/main/java/com/yahoo/application/Application.java