@Test
public void testValidateAuthenticator_privateNullary() throws Exception {

  final class InvalidAuthenticator implements Authenticator {
    @SuppressWarnings("unused")
    private InvalidAuthenticator() {}
    @SuppressWarnings("unused")
    @Override
    public User authenticate(HttpServletRequest request) {
      return null;
    }
  }
  config.getApiClassConfig().getMethods()
      .get(methodToEndpointMethod(TestEndpoint.class.getMethod("getResultNoParams")))
      .setAuthenticators(
          ImmutableList.<Class<? extends Authenticator>>of(InvalidAuthenticator.class));
  try {
    validator.validate(config);
    fail();
  } catch (InvalidConstructorException expected) {
    assertTrue(expected.getMessage().contains("Invalid custom authenticator"));
    assertTrue(expected.getMessage().endsWith(
        "InvalidAuthenticator. It must have a public nullary constructor."));
  }
}