Buggy code:
public class MvcNamespaceTests { public static final String VIEWCONTROLLER_BEAN_NAME = "org.springframework.web.servlet.config.viewControllerHandlerMapping" ; private GenericWebApplicationContext appContext ; private MvcNamespaceTests . TestController handler ; private HandlerMethod handlerMethod ; @ Before public void setUp ( ) throws Exception { } @ Test public void testDefaultConfig ( ) throws Exception { } @ Test ( expected = TypeMismatchException . class ) public void testCustomConversionService ( ) throws Exception { } @ Test public void testCustomValidator ( ) throws Exception { } @ Test public void testCustomValidator32 ( ) throws Exception { } private void doTestCustomValidator ( String xml ) throws Exception { } @ Test public void testInterceptors ( ) throws Exception { } @ Test public void testResources ( ) throws Exception { } @ Test public void testResourcesWithOptionalAttributes ( ) throws Exception { } @ Test public void testResourcesWithResolversTransformers ( ) throws Exception { } @ Test public void testResourcesWithResolversTransformersCustom ( ) throws Exception { } @ Test public void testDefaultServletHandler ( ) throws Exception { } @ Test public void testDefaultServletHandlerWithOptionalAttributes ( ) throws Exception { } @ Test public void testBeanDecoration ( ) throws Exception { } @ Test public void testViewControllers ( ) throws Exception { } @ Test public void testViewControllersOnWebSphere ( ) throws Exception { } @ Test public void testViewControllersDefaultConfig ( ) { } @ Test public void testContentNegotiationManager ( ) throws Exception { } @ Test public void testAsyncSupportOptions ( ) throws Exception { } @ Test public void testViewResolution ( ) throws Exception { loadBeanDefinitions ( "mvc-config-view-resolution.xml" , 6 ) ; ViewResolverComposite compositeResolver = this . appContext . getBean ( ViewResolverComposite . class ) ; assertNotNull ( compositeResolver ) ; assertEquals ( ( "Actual:<seq2seq4repair_space>" + ( compositeResolver . getViewResolvers ( ) ) ) , 8 , compositeResolver . getViewResolvers ( ) . size ( ) ) ; <START_BUG> assertEquals ( 0 , compositeResolver . getOrder ( ) ) ; <END_BUG> List < ViewResolver > resolvers = compositeResolver . getViewResolvers ( ) ; assertEquals ( BeanNameViewResolver . class , resolvers . get ( 0 ) . getClass ( ) ) ; ViewResolver resolver = resolvers . get ( 1 ) ; assertEquals ( InternalResourceViewResolver . class , resolver . getClass ( ) ) ; DirectFieldAccessor accessor = new DirectFieldAccessor ( resolver ) ; assertEquals ( InternalResourceView . class , accessor . getPropertyValue ( "viewClass" ) ) ; assertEquals ( TilesViewResolver . class , resolvers . get ( 2 ) . getClass ( ) ) ; resolver = resolvers . get ( 3 ) ; FreeMarkerViewResolver freeMarkerViewResolver = ( ( FreeMarkerViewResolver ) ( resolver ) ) ; accessor = new DirectFieldAccessor ( resolver ) ; assertEquals ( "freemarker-" , accessor . getPropertyValue ( "prefix" ) ) ; assertEquals ( ".freemarker" , accessor . getPropertyValue ( "suffix" ) ) ; assertArrayEquals ( new String [ ] { "my*" , "*Report" } , ( ( String [ ] ) ( accessor . getPropertyValue ( "viewNames" ) ) ) ) ; assertEquals ( 1024 , accessor . getPropertyValue ( "cacheLimit" ) ) ; resolver = resolvers . get ( 4 ) ; VelocityViewResolver velocityViewResolver = ( ( VelocityViewResolver ) ( resolver ) ) ; accessor = new DirectFieldAccessor ( resolver ) ; assertEquals ( "" , accessor . getPropertyValue ( "prefix" ) ) ; assertEquals ( ".vm" , accessor . getPropertyValue ( "suffix" ) ) ; assertEquals ( 0 , accessor . getPropertyValue ( "cacheLimit" ) ) ; resolver = resolvers . get ( 5 ) ; GroovyMarkupViewResolver groovyMarkupViewResolver = ( ( GroovyMarkupViewResolver ) ( resolver ) ) ; accessor = new DirectFieldAccessor ( resolver ) ; assertEquals ( "" , accessor . getPropertyValue ( "prefix" ) ) ; assertEquals ( ".tpl" , accessor . getPropertyValue ( "suffix" ) ) ; assertEquals ( 1024 , accessor . getPropertyValue ( "cacheLimit" ) ) ; assertEquals ( InternalResourceViewResolver . class , resolvers . get ( 6 ) . getClass ( ) ) ; assertEquals ( InternalResourceViewResolver . class , resolvers . get ( 7 ) . getClass ( ) ) ; TilesConfigurer tilesConfigurer = appContext . getBean ( TilesConfigurer . class ) ; assertNotNull ( tilesConfigurer ) ; String [ ] definitions = new String [ ] { "//org//springframework//web//servlet//resource//tiles//tiles1.xml" , "//org//springframework//web//servlet//resource//tiles//tiles2.xml" } ; accessor = new DirectFieldAccessor ( tilesConfigurer ) ; assertArrayEquals ( definitions , ( ( String [ ] ) ( accessor . getPropertyValue ( "definitions" ) ) ) ) ; assertTrue ( ( ( boolean ) ( accessor . getPropertyValue ( "checkRefresh" ) ) ) ) ; FreeMarkerConfigurer freeMarkerConfigurer = appContext . getBean ( FreeMarkerConfigurer . class ) ; assertNotNull ( freeMarkerConfigurer ) ; accessor = new DirectFieldAccessor ( freeMarkerConfigurer ) ; assertArrayEquals ( new String [ ] { "//" , "//test" } , ( ( String [ ] ) ( accessor . getPropertyValue ( "templateLoaderPaths" ) ) ) ) ; VelocityConfigurer velocityConfigurer = appContext . getBean ( VelocityConfigurer . class ) ; assertNotNull ( velocityConfigurer ) ; accessor = new DirectFieldAccessor ( velocityConfigurer ) ; assertEquals ( "//test" , accessor . getPropertyValue ( "resourceLoaderPath" ) ) ; GroovyMarkupConfigurer groovyMarkupConfigurer = appContext . getBean ( GroovyMarkupConfigurer . class ) ; assertNotNull ( groovyMarkupConfigurer ) ; assertEquals ( "//test" , groovyMarkupConfigurer . getResourceLoaderPath ( ) ) ; assertTrue ( groovyMarkupConfigurer . isAutoIndent ( ) ) ; assertFalse ( groovyMarkupConfigurer . isCacheTemplates ( ) ) ; } @ Test public void testViewResolutionWithContentNegotiation ( ) throws Exception { } @ Test public void testPathMatchingHandlerMappings ( ) throws Exception { } private void loadBeanDefinitions ( String fileName , int expectedBeanCount ) { } @ Controller public static class TestController { private boolean recordedValidationError ; @ RequestMapping public void testBind ( @ RequestParam @ DateTimeFormat ( iso = ISO . DATE ) Date date , @ Validated ( MvcNamespaceTests . MyGroup . class ) MvcNamespaceTests . TestBean bean , BindingResult result ) { } } public static class TestValidator implements Validator { boolean validatorInvoked ; @ Override public boolean supports ( Class < ? > clazz ) { }

Fix:
assertEquals ( LOWEST_PRECEDENCE , compositeResolver . getOrder ( ) ) ;