public Collection<T> getReferenceTargetElements(final ModelElementInstance referenceSourceElement) {

    return new Collection<T>() {

      public int size() {
        return getView(referenceSourceElement).size();
      }

      public boolean isEmpty() {
        return getView(referenceSourceElement).isEmpty();
      }

      public boolean contains(Object o) {
        if (o == null) {
          return false;
        }
        else if (!(o instanceof ModelElementInstanceImpl)) {
          return false;
        }
        else {
          return getView(referenceSourceElement).contains(((ModelElementInstanceImpl)o).getDomElement());
        }
      }

      public Iterator<T> iterator() {
        Collection<T> modelElementCollection = ModelUtil.getModelElementCollection(getView(referenceSourceElement), (ModelInstanceImpl) referenceSourceElement.getModelInstance());
        return modelElementCollection.iterator();
      }

      public Object[] toArray() {
        Collection<T> modelElementCollection = ModelUtil.getModelElementCollection(getView(referenceSourceElement), (ModelInstanceImpl) referenceSourceElement.getModelInstance());
        return modelElementCollection.toArray();
      }

      public <T1> T1[] toArray(T1[] a) {
        Collection<T> modelElementCollection = ModelUtil.getModelElementCollection(getView(referenceSourceElement), (ModelInstanceImpl) referenceSourceElement.getModelInstance());
        return modelElementCollection.toArray(a);
      }

      public boolean add(T t) {
        if (!contains(t)) {
          performAddOperation(referenceSourceElement, t);
        }
        return true;
      }

      public boolean remove(Object o) {
        ModelUtil.ensureInstanceOf(o, ModelElementInstanceImpl.class);
        performRemoveOperation(referenceSourceElement, o);
        return true;
      }

      public boolean containsAll(Collection<?> c) {
        Collection<T> modelElementCollection = ModelUtil.getModelElementCollection(getView(referenceSourceElement), (ModelInstanceImpl) referenceSourceElement.getModelInstance());
        return modelElementCollection.containsAll(c);
      }

      public boolean addAll(Collection<? extends T> c) {
        boolean result = false;
        for (T o: c) {
          result |= add(o);
        }
        return result;
      }

      public boolean removeAll(Collection<?> c) {
        boolean result = false;
        for (Object o: c) {
          result |= remove(o);
        }
        return result;
      }

      public boolean retainAll(Collection<?> c) {
        throw new UnsupportedModelOperationException("retainAll()", "not implemented");
      }

      public void clear() {
        performClearOperation(referenceSourceElement);
      }
    };

  }