My feelings about this issue are a little bit ambivalent.
On the one hand side the servlet and filter names are used in other parts of the ServletContext API, for example in getServletRegistrations(). If one would make filterName/servletName optional, then the behaviour for those methods would be unclear.
On the other hand, there is no need for a name, if you configure your whole WebApp using the addServlet/addFilter-Mechanism: The filterName is mainly usefull to reference your servlet from other locations. When using the Java API, javax.servlet.ServletRegistration.Dynamic/javax.servlet.FilterRegistration.Dynamic are used to reference your Servlet/Filter registrations. So, for those users, having to generate a unique name for each servlet and each filter is useless and may also be non-trivial when you are writing generic frameworks (for example).
From my point of view, having a way to define anonymous filters/servlets would be a very nice thing to have. One (ugly) way to allow this would be, to allow null values hier. A better way would probably be to add
public ServletRegistration.Dynamic addServlet(String className);
public ServletRegistration.Dynamic addServlet(Servlet servlet);
public ServletRegistration.Dynamic addServlet(Class <? extends Servlet> servletClass);
public FilterRegistration.Dynamic addFilter(String className);
public FilterRegistration.Dynamic addFilter(Filter filter);
public FilterRegistration.Dynamic addFilter(Class <? extends Filter> filterClass);
to the ServletContext interface.