@Test public void testNameMkyong() { MessageBuilder obj = new MessageBuilder(); assertEquals("Hello mkyong", obj.getMessage("mkyong")); }
public String getMessage(String name) { StringBuilder result = new StringBuilder(); if (name == null || name.trim().length() == 0) { result.append("Please provide a name!"); } else { result.append("Hello " + name); } return result.toString(); }
MessageBuilder { public String getMessage(String name) { StringBuilder result = new StringBuilder(); if (name == null || name.trim().length() == 0) { result.append("Please provide a name!"); } else { result.append("Hello " + name); } return result.toString(); } }
MessageBuilder { public String getMessage(String name) { StringBuilder result = new StringBuilder(); if (name == null || name.trim().length() == 0) { result.append("Please provide a name!"); } else { result.append("Hello " + name); } return result.toString(); }  }
MessageBuilder { public String getMessage(String name) { StringBuilder result = new StringBuilder(); if (name == null || name.trim().length() == 0) { result.append("Please provide a name!"); } else { result.append("Hello " + name); } return result.toString(); }  String getMessage(String name); }
MessageBuilder { public String getMessage(String name) { StringBuilder result = new StringBuilder(); if (name == null || name.trim().length() == 0) { result.append("Please provide a name!"); } else { result.append("Hello " + name); } return result.toString(); }  String getMessage(String name);  }