Updated code imported from spring-core.

Signed-off-by: Paulo Pires <pjpires@gmail.com>
Fixed ignored test.

Signed-off-by: Paulo Pires <pjpires@gmail.com>