How do you pass in null values into a HashMap?
The following code snippet works with options filled in:
HashMap options = new HashMap
It seems that you are trying to call a method with a Map parameter. So, to call with an empty person name the right approach should be
HashMap options = new HashMap();
options.put("name", null);
Person person = sample.searchPerson(options);
Or you can do it like this
HashMap options = new HashMap();
Person person = sample.searchPerson(options);
Using
Person person = sample.searchPerson(null);
Could get you a null pointer exception. It all depends on the implementation of searchPerson() method.