@Override
  public void start() {
    MasterServletFilter masterServletFilter = MasterServletFilter.getInstance();
    if (masterServletFilter != null) {
      // Probably a database upgrade. MasterSlaveFilter was instantiated by the servlet container
      // while spring was not completely up.
      // See https://jira.sonarsource.com/browse/SONAR-3612
      masterServletFilter.initHttpFilters(Arrays.asList(httpFilters));
      masterServletFilter.initServletFilters(Arrays.asList(servletFilters));
    }
  }
@Test
  public void filters_should_be_optional() {
    MasterServletFilter.setInstance(mock(MasterServletFilter.class));
    new RegisterServletFilters().start();
    // do not fail
    verify(MasterServletFilter.getInstance()).initHttpFilters(anyList());
    verify(MasterServletFilter.getInstance()).initServletFilters(anyList());
  }