Source:
public void setGame(Game game) { Assert.isNull(this.game, "Game has already been set"); this.game = game; modService.getFeaturedMod(game.getFeaturedMod()) .thenAccept(featuredModBean -> Platform.runLater(() -> gameTypeLabel.setText(StringUtils.defaultString(featuredModBean.getDisplayName())))); gameTitleLabel.textProperty().bind(game.titleProperty()); hostLabel.setText(game.getHost()); StringBinding mapNameBinding = createStringBinding( () -> mapService.getMapLocallyFromName(game.getMapFolderName()) .map(MapBean::getDisplayName) .orElse(game.getMapFolderName()), game.mapFolderNameProperty()); JavaFxUtil.bind(gameMapLabel.textProperty(), mapNameBinding); numberOfPlayersLabel.textProperty().bind(createStringBinding( () -> i18n.get("game.players.format", game.getNumPlayers(), game.getMaxPlayers()), game.numPlayersProperty(), game.maxPlayersProperty() )); avgRatingLabel.textProperty().bind(createStringBinding( () -> { OptionalDouble avgRating = game.getTeams().values().stream() .flatMap(Collection::stream) .map(playerService::getPlayerForUsername) .filter(Optional::isPresent) .map(Optional::get) .mapToInt(p -> RatingUtil.getRating(p.getGlobalRatingMean(), p.getGlobalRatingDeviation())) .average(); if (avgRating.isPresent()) { return String.format("%.0f", Math.round(avgRating.getAsDouble() / 100.0) * 100.0); } else { return "-"; } }, game.teamsProperty() )); ObservableMap<String, String> simMods = game.getSimMods(); modsLabel.textProperty().bind(createStringBinding(() -> getSimModsLabelContent(simMods), simMods)); mapImageView.imageProperty().bind(createObjectBinding( () -> mapService.loadPreview(game.getMapFolderName(), PreviewSize.SMALL), game.mapFolderNameProperty() )); lockIconLabel.visibleProperty().bind(game.passwordProtectedProperty()); }

Target:
public void setGame(Game game) { Assert.isNull(this.game, "Game has already been set"); this.game = game; modService.getFeaturedMod(game.getFeaturedMod()) .thenAccept(featuredModBean -> Platform.runLater(() -> gameTypeLabel.setText(StringUtils.defaultString(featuredModBean.getDisplayName())))); gameTitleLabel.textProperty().bind(game.titleProperty()); hostLabel.setText(game.getHost()); StringBinding mapNameBinding = createStringBinding( () -> mapService.getMapLocallyFromName(game.getMapFolderName()) .map(MapBean::getDisplayName) .orElse(game.getMapFolderName()), game.mapFolderNameProperty()); JavaFxUtil.bind(gameMapLabel.textProperty(), mapNameBinding); numberOfPlayersLabel.textProperty().bind(createStringBinding( () -> i18n.get("game.players.format", game.getNumPlayers(), game.getMaxPlayers()), game.numPlayersProperty(), game.maxPlayersProperty() )); avgRatingLabel.textProperty().bind(createStringBinding( () -> { OptionalDouble avgRating = game.getTeams().values().stream() .flatMap(Collection::stream) .map(playerService::getPlayerForUsername) .filter(Optional::isPresent) .map(Optional::get) .mapToInt(player -> RatingUtil.getRating(player.getGlobalRatingMean(), player.getGlobalRatingDeviation())) .average(); if (avgRating.isPresent()) { return i18n.get("game.avgRating.format", Math.round(avgRating.getAsDouble() / 100.0) * 100.0); } else { return "-"; } }, game.teamsProperty() )); ObservableMap<String, String> simMods = game.getSimMods(); modsLabel.textProperty().bind(createStringBinding(() -> getSimModsLabelContent(simMods), simMods)); mapImageView.imageProperty().bind(createObjectBinding( () -> mapService.loadPreview(game.getMapFolderName(), PreviewSize.SMALL), game.mapFolderNameProperty() )); lockIconLabel.visibleProperty().bind(game.passwordProtectedProperty()); }