@Test
public void duplicateNameResolutionTest() {

    // Mock out a simple resolver that does the resolution based on number of parameters
    Mockito.when(settings.duplicateEndpointNameResolver()).thenReturn(new DuplicateMethodNameResolver() {
        @Override
        public Map<Method, String> resolveDuplicateNames(List<Method> methodsWithSameName) {
            Map<Method, String> result = Maps.newHashMap();
            for (Method method : methodsWithSameName) {
                if (method.getParameterTypes().length > 0) {
                    result.put(method, "nonZeroParameters");
                } else {
                    result.put(method, "zeroParameters");
                }
            }
            return result;
        }
    });
    ServiceModel model = serviceClassParser.parseServiceClass(DuplicateMethodNamesService.class, settings);
    assertEquals(1, model.innerServiceModels().size());
    List<ServiceEndpointModel> endpointModels = Lists.newArrayList(model.innerServiceModels().get(0).endpointModels().iterator());
    Collections.sort(endpointModels);
    assertEquals(Lists.newArrayList("nonZeroParameters", "zeroParameters"),
                 endpointModels.stream().map(endpoint -> endpoint.endpointName()).collect(Collectors.toList()));
    assertTrue(endpointModels.get(0).parameters().size() > 0);
    assertTrue(endpointModels.get(1).parameters().size() == 0);
}