### Question:
CheckModuleAdapter extends ModuleVisitor { @Override public void visitProvide(final String service, final String... providers) { checkVisitEndNotCalled(); CheckMethodAdapter.checkInternalName(Opcodes.V9, service, "service"); providedServices.checkNameNotAlreadyDeclared(service); if (providers == null || providers.length == 0) { throw new IllegalArgumentException("Providers cannot be null or empty"); } for (String provider : providers) { CheckMethodAdapter.checkInternalName(Opcodes.V9, provider, "provider"); } super.visitProvide(service, providers); } CheckModuleAdapter(final ModuleVisitor moduleVisitor, final boolean isOpen); protected  CheckModuleAdapter(
      final int api, final ModuleVisitor moduleVisitor, final boolean isOpen); @Override void visitMainClass(final String mainClass); @Override void visitPackage(final String packaze); @Override void visitRequire(final String module, final int access, final String version); @Override void visitExport(final String packaze, final int access, final String... modules); @Override void visitOpen(final String packaze, final int access, final String... modules); @Override void visitUse(final String service); @Override void visitProvide(final String service, final String... providers); @Override void visitEnd();  }### Answer:
@Test public void testVisitProvide_nullProviderList() { CheckModuleAdapter checkModuleAdapter = new CheckModuleAdapter(null, false); Executable visitProvide = () -> checkModuleAdapter.visitProvide("service2", (String[]) null); Exception exception = assertThrows(IllegalArgumentException.class, visitProvide); assertEquals("Providers cannot be null or empty", exception.getMessage()); }
@Test public void testVisitProvide_emptyProviderList() { CheckModuleAdapter checkModuleAdapter = new CheckModuleAdapter(null, false); Executable visitProvide = () -> checkModuleAdapter.visitProvide("service1"); Exception exception = assertThrows(IllegalArgumentException.class, visitProvide); assertEquals("Providers cannot be null or empty", exception.getMessage()); }