@Test void testAdd() { Package groupPackage = mockGroupPackage("group"); groupPackageRepositoryDecorator.add(groupPackage); assertAll( () -> verify(delegateRepository).add(groupPackage), () -> verify(groupPackageService).createGroup(groupPackage)); }
@Override public void add(Package aPackage) { super.add(aPackage); if (isGroupPackage(aPackage)) { groupPackageService.createGroup(aPackage); } }
GroupPackageRepositoryDecorator extends AbstractRepositoryDecorator<Package> { @Override public void add(Package aPackage) { super.add(aPackage); if (isGroupPackage(aPackage)) { groupPackageService.createGroup(aPackage); } } }
GroupPackageRepositoryDecorator extends AbstractRepositoryDecorator<Package> { @Override public void add(Package aPackage) { super.add(aPackage); if (isGroupPackage(aPackage)) { groupPackageService.createGroup(aPackage); } } GroupPackageRepositoryDecorator(
      Repository<Package> delegateRepository, GroupPackageService groupPackageService); }
GroupPackageRepositoryDecorator extends AbstractRepositoryDecorator<Package> { @Override public void add(Package aPackage) { super.add(aPackage); if (isGroupPackage(aPackage)) { groupPackageService.createGroup(aPackage); } } GroupPackageRepositoryDecorator(
      Repository<Package> delegateRepository, GroupPackageService groupPackageService); @Override void add(Package aPackage); @Override Integer add(Stream<Package> packageStream); @Override void update(Package aPackage); @Override void update(Stream<Package> packageStream); @Override void delete(Package aPackage); @Override void deleteById(Object id); @Override void deleteAll(); @Override void delete(Stream<Package> packages); @Override void deleteAll(Stream<Object> ids); }
GroupPackageRepositoryDecorator extends AbstractRepositoryDecorator<Package> { @Override public void add(Package aPackage) { super.add(aPackage); if (isGroupPackage(aPackage)) { groupPackageService.createGroup(aPackage); } } GroupPackageRepositoryDecorator(
      Repository<Package> delegateRepository, GroupPackageService groupPackageService); @Override void add(Package aPackage); @Override Integer add(Stream<Package> packageStream); @Override void update(Package aPackage); @Override void update(Stream<Package> packageStream); @Override void delete(Package aPackage); @Override void deleteById(Object id); @Override void deleteAll(); @Override void delete(Stream<Package> packages); @Override void deleteAll(Stream<Object> ids);  }