Convert method to closure

I have the following code:

def veifySequence() {
    boolean checkB(list) {
			def WEIGHTS = [ 10, 10.5, 11, 11.5, 12, 12.5, 13, 13.5, 1, 1.5, 2, 2.5, 3 ]*.toDouble().asImmutable()
			list == list.toSorted{ WEIGHTS.indexOf it.toDouble() }
		}

		assert checkB( ['10', '11', '13', '1', '2', '2.5'] )
		assert checkB( ['11.5', '2', '3'] )
		assert checkB( ['12', '2'] )
		assert !checkB( ['11', '10', '1', '13', '2', '2.5'] )
		assert !checkB( ['1', '12', '3'] )
}

But I am getting error on the line where boolean is mentioned that Description Resource Path Location Type Groovy:Method definition not expected here. Please define the method at an appropriate place or perhaps try using a block/Closure instead.

Does someone know how to convert it to closure to avoid the error

Please find the following:

import java.util.stream.Collectors

boolean checkB(List<String> list) {
	List<Double> ld = list.stream().map({s -> Double.parseDouble(s)}).collect(Collectors.toList())
	return ld == ld.toSorted()
}

def verifySequence() {
	assert ! checkB( ['10', '11', '13', '1', '2', '2.5'] )
	assert ! checkB( ['11.5', '2', '3'] )
	assert ! checkB( ['12', '2'] )
	assert ! checkB( ['11', '10', '1', '13', '2', '2.5'] )
	assert ! checkB( ['1', '12', '3'] )

	assert checkB( ['1', '2', '2.5', '10', '11', '13'] )
	assert checkB( ['2', '3', '11.5'] )
	assert checkB( ['2', '12'] )
	assert checkB( ['1', '2', '2.5', '10', '11', '13'] )
	assert checkB( ['1', '3', '12'] )
}

verifySequence()

This works for me.