beforeEach(function () {
  jasmine.addMatchers({
    toBeInSystem() {
      return {
        compare(actual, expected) {
          const entity = actual;
          const system = expected;
          system.enrollEntities();
          return {
            pass: system.entities.includes(entity)
          };
        },
      };
    },
    toMatchNumberOfEntities() {
      return {
        compare(actual, expected) {
          const system = actual;
          system.enrollEntities();
          return {
            pass: system.entities.length === expected
          };
        },
      };
    },
  });
});

beforeEach(function () {
  jasmine.addMatchers({
    toBeInSystem() {
      return {
        compare(actual, expected) {
          const entity = actual;
          const system = expected;
          const entities = system.getMatchingEntities();
          return {
            pass: entities.includes(entity)
          };
        },
      };
    },
    toMatchNumberOfEntities() {
      return {
        compare(actual, expected) {
          const system = actual;
          const entities = system.getMatchingEntities();
          return {
            pass: entities.length === expected
          };
        },
      };
    },
  });
});

Handle deprecated system method enrollEntities
Handle deprecated system method enrollEntities

