@Test public void testBuildWizard() { final Character character = CharacterStepBuilder.newBuilder() .name("Merlin") .wizardClass("alchemist") .withSpell("poison") .withAbility("invisibility") .withAbility("wisdom") .noMoreAbilities() .build(); assertEquals("Merlin", character.getName()); assertEquals("alchemist", character.getWizardClass()); assertEquals("poison", character.getSpell()); assertNotNull(character.toString()); final List<String> abilities = character.getAbilities(); assertNotNull(abilities); assertEquals(2, abilities.size()); assertTrue(abilities.contains("invisibility")); assertTrue(abilities.contains("wisdom")); }
public static NameStep newBuilder() { return new CharacterSteps(); }
CharacterStepBuilder { public static NameStep newBuilder() { return new CharacterSteps(); } }
CharacterStepBuilder { public static NameStep newBuilder() { return new CharacterSteps(); } private  CharacterStepBuilder(); }
CharacterStepBuilder { public static NameStep newBuilder() { return new CharacterSteps(); } private  CharacterStepBuilder(); static NameStep newBuilder(); }
CharacterStepBuilder { public static NameStep newBuilder() { return new CharacterSteps(); } private  CharacterStepBuilder(); static NameStep newBuilder();  }