private Collection < String > checkMethodNames ( Collection < HttpMethodConstraintElement > methodConstraints ) { Collection < String > methodNames = new HashSet < String > ( ) ; for ( HttpMethodConstraintElement methodConstraint : methodConstraints ) { String methodName = methodConstraint . getMethodName ( ) ; if ( ! methodNames . add ( methodName ) ) { throw new IllegalArgumentException ( "Duplicate HTTP method name: " + methodName ) ; } } return methodNames ; }
Checks for duplicate method names in methodConstraints .