NameService service = NameService.getInstance(names);
List matching = service.findNames(prefix);
I came across a book and tried the code shown there. However, part of the codes (highlighted-as shown above) have some problem. The NameService couldn't call the .getInstance(names) function. Maybe...