@Test
public void mergeThemeWithTwoSubthemesWithTwoLayersWithOpaqueAndWithoutOpaque() {

    final MapOptions mapOptionsWithOpaque = new MapOptions( null, null, null, -1, -1, true );
    final Layer layerWithOpaque = createLayer( "LayerWithOpaque", -180.0, -90.0, 180.0, 90, mapOptionsWithOpaque );
    final List<Layer> layersWithOpaque = Collections.singletonList( layerWithOpaque );
    final Theme subThemeWithOpaque = createTheme( "SubthemeWithOpaque", -180.0, -90.0, 180.0, 90, layersWithOpaque,
                                                  null, null );
    final MapOptions mapOptionsWithoutOpaque = new MapOptions( null, null, null, -1, -1, false );
    final Layer layerWithoutOpaque = createLayer( "LayerWithoutOpaque", -180.0, -90.0, 180.0, 90,
                                                  mapOptionsWithoutOpaque );
    final List<Layer> layersWithoutOpaque = Collections.singletonList( layerWithoutOpaque );
    final Theme subThemeWithoutOpaque = createTheme( "SubthemeWithoutOpaque", -180.0, -90.0, 180.0, 90,
                                                     layersWithoutOpaque, null, null );
    final List<Theme> subThemes = asList( subThemeWithOpaque, subThemeWithoutOpaque );
    final Theme theme = createThemeWithoutMetadata( "Theme", null, subThemes );
    final LayerMetadata mergedTheme = merger.merge( theme );
    final LayerMetadata mergedSubThemeWithOpaque = merger.merge( subThemeWithOpaque );
    final LayerMetadata mergedSubThemeWithoutOpaque = merger.merge( subThemeWithoutOpaque );
    assertThat( mergedTheme.getMapOptions().isOpaque(), is( true ) );
    assertThat( mergedSubThemeWithOpaque.getMapOptions().isOpaque(), is( true ) );
    assertThat( mergedSubThemeWithoutOpaque.getMapOptions().isOpaque(), is( false ) );
}