code: def test_memo_add_under_existing_group(self):
      group_expr1 = MagicMock()
      group_expr1.group_id = UNDEFINED_GROUP_ID
      group_expr2 = MagicMock()
      group_expr2.group_id = 0
  
      memo = Memo()
      expr = memo.add_group_expr(group_expr1)
      ret_expr = memo.add_group_expr(group_expr2)
      self.assertEqual(expr.group_id, 0)
      self.assertEqual(ret_expr.group_id, 1)
      self.assertEqual(len(memo.groups), 2)
      self.assertEqual(len(memo.group_exprs), 2)
  
      memo = Memo()
      memo.add_group_expr(group_expr2)
      expr = memo.add_group_expr(group_expr1)
      self.assertEqual(expr.group_id, 1)
      self.assertEqual(len(memo.groups), 2)
      self.assertEqual(len(memo.group_exprs), 2)
  
file_path: evadb/test/unit_tests/optimizer/test_memo.py
imports: import unittest
  from mock import MagicMock
  from evadb.constants import UNDEFINED_GROUP_ID
  from evadb.optimizer.memo import Memo
label_desc: Use image node_id 3 for calling the MemoTest obj's underlying member method code with example usage: obj.test_memo_add_under_existing_group() without return types