code: public synchronized <T> List<T> getAttachmentList(AttachmentKey<? extends List<T>> key) {
          if (key == null) {
              return null;
          }
          List<T> list = key.cast(attachments.get(key));
          if (list == null) {
              return Collections.emptyList();
          }
          return list;
      }
docs: {@inheritDoc}