class DefaultDataProviderMethodResolver implements DataProviderMethodResolver {

    @Override
    public List<Method> resolve(DataProviderResolverContext context) {
        checkNotNull(context, "'context' must not be null");

        List<Method> dataProviderMethods = findAnnotatedMethods(context.getLocations(),
                context.getDataProviderAnnotationClass());

        List<Method> result = new ArrayList<Method>();
        for (Method dataProviderMethod : dataProviderMethods) {
            if (context.useDataProviderNameConvention()) {
                if (isMatchingNameConvention(context.getTestMethod().getName(), dataProviderMethod.getName())) {
                    result.add(dataProviderMethod);
                }
            } else if (dataProviderMethod.getName().equals(context.getDataProviderName())) {
                result.add(dataProviderMethod);
            }
        }
        return result;
    }

}