@Test
    public void firstNonNullWins() {
        ModuleInformation info1 = new ModuleInformation();
        ModuleInformation info2 = new ModuleInformation();
        ModuleInformationResolver resolver1 = Mockito.mock(ModuleInformationResolver.class);
        Mockito.when(resolver1.resolve(Mockito.any(ModuleDefinition.class))).thenReturn(info1);
        ModuleInformationResolver resolver2 = Mockito.mock(ModuleInformationResolver.class);
        Mockito.when(resolver2.resolve(Mockito.any(ModuleDefinition.class))).thenReturn(info2);

        DelegatingModuleInformationResolver resolver = new DelegatingModuleInformationResolver();
        resolver.setDelegates(Arrays.asList(resolver1, resolver2));

        ModuleInformation result = resolver.resolve(ModuleDefinitions.simple("foo", ModuleType.processor, "classpath:dontcare"));
        assertThat(result, CoreMatchers.equalTo(info1));

    }
Unit tests for DelegatingModuleInformationResolver.

@author Eric Bottard
spring-xd-module/src/test/java/org/springframework/xd/module/info/DelegatingModuleInformationResolverTests.java