Action { protected List<String> getKeysOnMemoryMatchingProviderKey(String providerKey) { List<String> keysMatchingProviderKey = new ArrayList<>(); for (String composedKeyMemory : memory.keySet()) { final String keyPartProviderMemory = composedKeyMemory.substring(0, composedKeyMemory.lastIndexOf(PREFIX_DYNAMIC_KEY)); if (providerKey.equals(keyPartProviderMemory)) { keysMatchingProviderKey.add(composedKeyMemory); } } return keysMatchingProviderKey; } Action(Memory memory, Persistence persistence);   }
@Test public void Check_Keys_Matching_Provider_Key() { List<String> keysMatchingProviderKey = actionUT.getKeysOnMemoryMatchingProviderKey(PROVIDER_KEY); assertThat(keysMatchingProviderKey.get(0), is(filter1Page1)); assertThat(keysMatchingProviderKey.get(1), is(filter1Page2)); assertThat(keysMatchingProviderKey.get(2), is(filter2Page1)); assertThat(keysMatchingProviderKey.get(3), is(filter2Page2)); assertThat(keysMatchingProviderKey.size(), is(4)); }