### Question:
NameGenerator { public String generate(String param){ switch (param.toUpperCase().trim()){ case "FIRSTNAME": return randomFirstName(); case "LASTNAME": return randomLastName(); default: return randomFullName(); } }  String randomFullName(); String randomFirstName(); String randomLastName(); String generate(String param);  }### Answer:
@Test public void testNameGenerator(){ NameGenerator nameGenerator = new NameGenerator(); String firstName = nameGenerator.generate("firstname"); String lastName = nameGenerator.generate("lastname"); String fullname = nameGenerator.generate("fullname"); Assert.assertNotNull(firstName); Assert.assertNotNull(lastName); Assert.assertNotNull(fullname); }