### Question:
HelloWorld { public void setName( String name ) throws IllegalArgumentException { if( name == null ) { throw new IllegalArgumentException( "Name may not be null " ); } this.name = name; }  String getPhrase(); void setPhrase( String phrase ); String getName(); void setName( String name ); String say();  }### Answer:
@Test public void givenHelloWorldWhenSetInvalidNameThenThrowException() { try { helloWorld.setName( null ); fail( "Should not be allowed to set name to null" ); } catch( IllegalArgumentException e ) { } }