class ViewCopyManager {

    public View copy(final long sourceViewId, final String newViewName) {
        // Retrieve view
        final Optional<View> sourceView = viewRepository.findById(sourceViewId);
        if (!sourceView.isPresent()) {
            throw new IllegalArgumentException("Unable to find view with id " + sourceViewId);
        }
        return copy(sourceView.get(), newViewName);
    }

    @Autowired public  ViewCopyManager(final ViewRepository viewRepository);

}