Source:
<code>public void descriptorOnHeapTest() { CacheManager cacheManager1 = null; try { CacheConfiguration<Long, String> cacheConfiguration = CacheConfigurationBuilder.newCacheConfigurationBuilder(Long.class, String.class, heap(10)) .build(); ManagementRegistryService managementRegistry = new DefaultManagementRegistryService(new DefaultManagementRegistryConfiguration().setCacheManagerAlias("myCM")); cacheManager1 = CacheManagerBuilder.newCacheManagerBuilder() .withCache("aCache", cacheConfiguration) .using(managementRegistry) .build(true); assertThat(managementRegistry.getCapabilities(), hasSize(4)); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(0).getName(), equalTo("ActionsCapability")); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(1).getName(), equalTo("StatisticsCapability")); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(2).getName(), equalTo("StatisticCollectorCapability")); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(3).getName(), equalTo("SettingsCapability")); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(0).getDescriptors(), hasSize(4)); Collection<Descriptor> descriptors = new ArrayList<Capability>(managementRegistry.getCapabilities()).get(1).getDescriptors(); Collection<Descriptor> allDescriptors = new ArrayList<Descriptor>(); allDescriptors.addAll(StatsUtil.ONHEAP_DESCRIPTORS); allDescriptors.addAll(StatsUtil.CACHE_DESCRIPTORS); assertThat(descriptors, hasSize(allDescriptors.size())); <START> assertThat(descriptors, containsInAnyOrder(allDescriptors.toArray())); <END> } finally { if(cacheManager1 != null) cacheManager1.close(); } }</code><technical_language>please this assertion hasSize. error message get 50 55 list of missing stats</technical_language>

Target:
public void descriptorOnHeapTest() { CacheManager cacheManager1 = null; try { CacheConfiguration<Long, String> cacheConfiguration = CacheConfigurationBuilder.newCacheConfigurationBuilder(Long.class, String.class, heap(10)) .build(); ManagementRegistryService managementRegistry = new DefaultManagementRegistryService(new DefaultManagementRegistryConfiguration().setCacheManagerAlias("myCM")); cacheManager1 = CacheManagerBuilder.newCacheManagerBuilder() .withCache("aCache", cacheConfiguration) .using(managementRegistry) .build(true); assertThat(managementRegistry.getCapabilities(), hasSize(4)); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(0).getName(), equalTo("ActionsCapability")); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(1).getName(), equalTo("StatisticsCapability")); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(2).getName(), equalTo("StatisticCollectorCapability")); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(3).getName(), equalTo("SettingsCapability")); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(0).getDescriptors(), hasSize(4)); Collection<Descriptor> descriptors = new ArrayList<Capability>(managementRegistry.getCapabilities()).get(1).getDescriptors(); Collection<Descriptor> allDescriptors = new ArrayList<Descriptor>(); allDescriptors.addAll(ONHEAP_DESCRIPTORS); allDescriptors.addAll(CACHE_DESCRIPTORS); assertThat(descriptors, containsInAnyOrder(allDescriptors.toArray())); assertThat(descriptors, hasSize(allDescriptors.size())); } finally { if(cacheManager1 != null) cacheManager1.close(); } }