code: public static void assertOpenActiveAndCurrent(@NonNull String ws, @NonNull String errorMsg) throws ND4JWorkspaceException {
          if (!Nd4j.getWorkspaceManager().checkIfWorkspaceExistsAndActive(ws)) {
              throw new ND4JWorkspaceException(errorMsg + " - workspace is not open and active");
          }
          MemoryWorkspace currWs = Nd4j.getMemoryManager().getCurrentWorkspace();
          if (currWs == null || !ws.equals(currWs.getId())) {
              throw new ND4JWorkspaceException(errorMsg + " - not the current workspace (current workspace: "
                      + (currWs == null ? null : currWs.getId()));
          }
      }
docs: Assert that the specified workspace is open, active, and is the current workspace
  
  @param ws       Name of the workspace to assert open/active/current
  @param errorMsg Message to include in the exception, if required