### Question:
EventDrivenUpdatesMap extends AbstractMap<String, String> implements Serializable { @Override @SuppressWarnings("unchecked") public String get(Object events) throws IllegalArgumentException { if (events instanceof Iterable) { return get((Iterable<String>) events, DEFAULT_VALUE); } else if (events instanceof String) { final String[] iter = parseEventsAndDefault((String) events); return get(iter[0], iter[1]); } throw new IllegalArgumentException("expected Iterable<String> or String but was " + events); } EventDrivenUpdatesMap();   EventDrivenUpdatesMap(Map<String, Set<String>> delegate); @Override @SuppressWarnings("unchecked") String get(Object events); String get(Iterable<String> events, String defaultValue); String get(String events, String defaultValue); void add(String events, String...ids); @Override Set<Map.Entry<String, String>> entrySet(); @Override String toString();  }### Answer:
@Test(expected = IllegalArgumentException.class) public void getFailsForObjectKey() { final EventDrivenUpdatesMap map = new EventDrivenUpdatesMap(DEFAULT_DELEGATE); map.get(new Object()); }
@Test(expected = IllegalArgumentException.class) public void getFailsForNullKey() { final EventDrivenUpdatesMap map = new EventDrivenUpdatesMap(DEFAULT_DELEGATE); map.get(null); }
@Test public void getSupportsIterableKey() { final EventDrivenUpdatesMap map = new EventDrivenUpdatesMap(DEFAULT_DELEGATE); final String ids = map.get(DEFAULT_DELEGATE.keySet()); for (String id : DEFAULT_DELEGATE.get("event-b")) { assertThat("missing ID", ids, containsString(id)); } }
@Test public void getSupportsStringKey() { final EventDrivenUpdatesMap map = new EventDrivenUpdatesMap(DEFAULT_DELEGATE); final String ids = map.get("event-a"); assertThat("unexpected ID", ids, is(DEFAULT_DELEGATE.get("event-a").iterator().next())); }
@Test public void getSupportsStringKeyWithMultipleEvents() { final EventDrivenUpdatesMap map = new EventDrivenUpdatesMap(DEFAULT_DELEGATE); final String ids = map.get("event-a event-b,event-c"); for (String id : DEFAULT_DELEGATE.get("event-b")) { assertThat("missing ID", ids, containsString(id)); } }
@Test public void getSupportsStringKeyWithDefaultValue() { final EventDrivenUpdatesMap map = new EventDrivenUpdatesMap(DEFAULT_DELEGATE); final String ids = map.get("event-c|test"); assertThat("expected default value", ids, is("test")); }