Spaghetti { static SpaghettiBuilders.SpaghettiBuilder.Cheese napoliBuilder() { return SpaghettiBuilders.spaghettiBuilder().sauce("tomato"); } @Builder(style = Style.IMMUTABLE) @Updater  Spaghetti(String cheese, @Step(0) String sauce, boolean alDente);   }
@Test public void napoliBuilder() throws Exception { Spaghetti spaghetti = Spaghetti.napoliBuilder() .cheese("reggiano") .alDente(true); assertTrue(spaghetti.alDente); assertThat(spaghetti.cheese, is("reggiano")); assertThat(spaghetti.sauce, is("tomato")); spaghetti = spaghettiUpdater(spaghetti) .sauce("hot salsa") .cheese("cheddar") .alDente(false).done(); assertFalse(spaghetti.alDente); assertThat(spaghetti.cheese, is("cheddar")); assertThat(spaghetti.sauce, is("hot salsa")); }