You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: tests.rs
    path of file: ./repos/farm/crates/compiler/src/update/patch_module_group_graph
    
    the code of the file until where you have to start completion: use std::collections::HashSet;

use farmfe_core::{
  module::{
    module_graph::{ModuleGraph, ModuleGraphEdge, ModuleGraphEdgeDataItem},
    Module,
  },
  plugin::ResolveKind,
};
use farmfe_plugin_partial_bundling::module_group_graph_from_entries;
use farmfe_testing_helpers::construct_test_module_graph;

use crate::update::diff_and_patch_module_graph::{diff_module_graph, patch_module_graph};

use super::patch_module_group_graph;

///
/// ```ignore
///      a
///     / \
///   b    d
///  /
/// c
/// ```
pub fn create_basic_graph() -> ModuleGraph {
  let mut module_graph = ModuleGraph::new();

  module_graph.add_module(Module::new("a".into()));
  module_graph.add_module(Module::new("b".into()));
  module_graph.add_module(Module::new("c".into()));
  module_graph.add_module(Module::new("d".into()));
  module_graph
    .add_edge(&"a".into(), &"b".into(), ModuleGraphEdge::default())
 
    
fn test_patch_module_group_graph_add_and_remove() {
  let mut module_graph = create_basic_graph();
  let mut update_module_graph = create_basic_graph();
  let module_e = Module::new("e".into());
  update_module_graph.add_module(module_e);
  update_module_graph
    .add_edge(&"a".into(), &"e".into(), Default::default())
    .unwrap();
  // remove a -> b and add e -> b
  update_module_graph
    .remove_edge(&"a".into(), &"b".into())
    .unwrap();
  update_module_graph
    .add_edge(&"e".into(), &"b".into(), Default::default())
    .unwrap();

  let start_points = vec!["a".into()];
  let mut module_group_graph = module_group_graph_from_entries(&start_points, &mut module_graph);
  let diff_result = diff_module_graph(start_points.clone(), &module_graph, &update_module_graph);
  let removed_modules = patch_module_graph(
    start_points.clone(),
    &diff_result,
    &mut module_graph,
    &mut update_module_graph,
  );

  let affected_groups = patch_module_group_graph(
    start_points.clone(),
    &diff_result,
    &removed_modules,
    &mut module_graph,
    &mut module_group_graph,
  );

  assert_eq!(affected_groups, HashSet::from(["a".into()]));

  let update_module_group_graph = module_group_graph_from_entries(&start_points, &mut module_graph);

  assert_eq!(module_group_graph, update_module_group_graph);

  // makes sure that module_groups field of each module is correct
  for module in module_graph.modules() {
    assert_eq!(module.module_groups, HashSet::from(["a".into()]));
  }
}