class WorkspaceHelper {

    /**
     * Hack functions that allows to get the Workspace from a given graph.
     *
     * @param graph graph
     * @return workspace this graph belongs to
     */
    public static Workspace getWorkspace(Graph graph) {<FILL_FUNCTION_BODY>}
}

        ProjectController projectController = Lookup.getDefault().lookup(ProjectController.class);
        if (projectController.getCurrentProject() == null) {
            return null;
        }
        WorkspaceProvider workspaceProvider =
            projectController.getCurrentProject().getLookup().lookup(WorkspaceProvider.class);
        for (Workspace workspace : workspaceProvider.getWorkspaces()) {
            GraphModel graphModel = workspace.getLookup().lookup(GraphModel.class);
            if (graphModel == graph.getModel()) {
                return workspace;
            }
        }
        throw new RuntimeException("The workspace can't be found");
    
<no_super_class>