@Test public void testBuildWarrior() { final Character character = CharacterStepBuilder.newBuilder() .name("Cuauhtemoc") .fighterClass("aztec") .withWeapon("spear") .withAbility("speed") .withAbility("strength") .noMoreAbilities() .build(); assertEquals("Cuauhtemoc", character.getName()); assertEquals("aztec", character.getFighterClass()); assertEquals("spear", character.getWeapon()); assertNotNull(character.toString()); final List<String> abilities = character.getAbilities(); assertNotNull(abilities); assertEquals(2, abilities.size()); assertTrue(abilities.contains("speed")); assertTrue(abilities.contains("strength")); }
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();  }