question: private List < String > validateExpectedPartitionValues ( List < String > expectedPartitionValues ) { Assert . notEmpty ( expectedPartitionValues , "At least one expected partition value must be specified." ) ; Set < String > validatedExpectedPartitionValuesSet = new LinkedHashSet < > ( ) ; for ( String expectedPartitionValue : expectedPartitionValues ) { String trimmedExpectedPartitionValue = alternateKeyHelper . validateStringParameter ( "An" , "expected partition value" , expectedPartitionValue ) ; if ( validatedExpectedPartitionValuesSet . contains ( trimmedExpectedPartitionValue ) ) { throw new IllegalArgumentException ( String . format ( "Duplicate expected partition value \"%s\" found." , trimmedExpectedPartitionValue ) ) ; } validatedExpectedPartitionValuesSet . add ( trimmedExpectedPartitionValue ) ; } List < String > validatedExpectedPartitionValues = new ArrayList < > ( validatedExpectedPartitionValuesSet ) ; Collections . sort ( validatedExpectedPartitionValues ) ; return validatedExpectedPartitionValues ; }
target:  Validate a list of expected partition values. This method also trims the expected partition values.