### Question:
KeySequenceConfigRepository { public boolean contains(CharSequence keySequenceConfigKey) { return map.containsKey(keySequenceConfigKey); } KeySequenceConfigRepository(Map<CharSequence, ItemSource> dataSource);  KeySequenceConfigRepository(Map<CharSequence, ItemSource> dataSource, long expireInMillis); KeySequenceConfig get(CharSequence key); boolean contains(CharSequence keySequenceConfigKey); void persist(KeySequenceConfig config); void purge(KeySequenceConfig config); Collection<KeySequenceConfig> getAll();  }### Answer:
@Test public void containsReturnsTrueIfElementPresentInGivenMap() { Map<CharSequence, ItemSource> map = createDefaultTestMap(); KeySequenceConfigRepository repository = new KeySequenceConfigRepository(map, DEFAULT_TEST_KEY_SEQUENCE_EXPIRY); KeySequenceConfig expected = createDefaultTestKeySequenceConfig(); map.put(expected.getKey(), expected); boolean result = repository.contains(expected.getKey()); assertTrue(result); }
@Test public void containsReturnsFalseIfElementNotPresentInGivenMap() { Map<CharSequence, ItemSource> map = createDefaultTestMap(); KeySequenceConfigRepository repository = new KeySequenceConfigRepository(map, DEFAULT_TEST_KEY_SEQUENCE_EXPIRY); boolean result = repository.contains(UUID.randomUUID().toString()); assertFalse(result); }