ItemsByTag { @Nullable @SuppressWarnings("unchecked") public <E> E get(@Nonnull Tag<E> tag) { Object got = map.getOrDefault(tag, NONE); if (got == NONE) { throw new IllegalArgumentException("No value associated with " + tag); } return (E) got; }  @Nonnull @SuppressWarnings({ "unchecked", "rawtypes" }) static ItemsByTag itemsByTag(@Nonnull Object... tagsAndVals); @Nullable @SuppressWarnings("unchecked") E get(@Nonnull Tag<E> tag); void put(@Nonnull Tag<E> tag, @Nullable E value); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test(expected = IllegalArgumentException.class) public void when_getNonexistent_then_exception() { ibt.get(tag1()); }