@Override public void copyTo(DataMapper target) { checkNotNull(target, "target"); if (isDistributed()) { Log.warn("Copy of a distributed back-end may lead to unexpected errors"); } Backend targetBackend; if (target instanceof Backend) { targetBackend = (Backend) target; } else if (target instanceof Store) { final Store targetStore = (Store) target; targetBackend = targetStore.backend(); } else { throw new IllegalStateException(String.format("Unable to copy a DataMapper of type %s", target.getClass())); } copyTo(targetBackend); }