DiscoverySelector (DiscoverySelector methodSelector, String param) { Integer index = null; if (param != null) { Matcher matcher = VALUE_SOURCE_PATTERN.matcher(param); if (matcher.find()) { String group = matcher.group(1); try { index = Integer.parseInt(group); } catch (NumberFormatException ignored) { } } } if (index != null) { try { return DiscoverySelectors.selectIteration(methodSelector, index); } catch (NoSuchMethodError e) { return null; } } return null; }