KeyTreeMap { public void put(final T object) { PortablePreconditions.checkNotNull("Object can not be null", object); final UUIDKey uuidKey = UUIDKey.getUUIDKey(object.keys()); if (keys.contains(uuidKey)) { throw new IllegalArgumentException("UUID already already in use. You are trying to add the same object twice."); } keys.add(uuidKey); for (final Key additionalKey : object.keys()) { put(additionalKey, object); } } KeyTreeMap(final KeyDefinition... keyIDs); void put(final T object); MultiMap<Value, T, List<T>> get(final KeyDefinition keyDefinition); void merge(final KeyTreeMap<T> keyTreeMap);  }
@Test(expected = IllegalArgumentException.class) public void testReAdd() throws Exception { put(toni); }