* @param baseDir the base dir for the embedded app
* @param function a function that builds a launch config from a launch config builder
* @return a newly created embedded application
*/
static EmbeddedApp fromLaunchConfigBuilder(Path baseDir, Function<? super LaunchConfigBuilder, ? extends LaunchConfig> function) {
return new LaunchConfigEmbeddedApp() {
@Override
protected LaunchConfig createLaunchConfig() {
return uncheck(() -> function.apply(LaunchConfigBuilder.baseDir(baseDir).development(true).port(0)));
}
};