Search module methods
I'd rename the searchModule method to readModuleName since it doesn't search, it just reads the name of the name of the searched module.
Instead of the iterators use the new foreach loop (as you already use it for the modules):

for (Student student: students) {
        ...
}

If you use iterators set the type parameter which makes the casting unnecessary:

final Iterator&lt;Student&gt; it = students.iterator(); // type parameter here
while (it.hasNext()) {
    Student student = it.next(); // no casting here
    ...
}

Declare variables on the first use:

Scanner scan = new Scanner(System.in);

Don't forget to close the Scanner That was a bad advice, since it closes System.in too. See also: Close a Scanner linked to System.in
Split up the moduleStudentSearch method, it does four things:


read the searched module name
search the module by name
search student by module
print the results


Each function should have a separate method:

public static void moduleStudentSearch(final Set&lt;Module&gt; modules, final Set&lt;Student&gt; students) {

    final String searchedModuleName = readModuleName();
    final Module module = searchModule(searchedModuleName, modules);
    if (module == null) {
        printNoModuleFound(searchedModuleName);
        return;
    }
    final Set&lt;Student&gt; studentsWithModule = getStudentsWithModule(students, module);
    printStudents(studentsWithModule);
}

private static void printNoModuleFound(String searchedModuleName) {
    System.out.println("No module found with name: " + searchedModuleName);
}

public static String readModuleName() {
    System.out.print("Search module code: ");
    final Scanner scan = new Scanner(System.in);
    try {
        final String searchModule = scan.nextLine().trim();
        return searchModule;
    } finally {
        scan.close();
    }
}

// you could return a list/set here if there are more than one results
public static Module searchModule(final String searchedModuleName, final Set&lt;Module&gt; modules) {
    for (final Module module: modules) {
        final String moduleName = module.getName();
        if (searchedModuleName.equalsIgnoreCase(moduleName)) {
            return module;
        }
    }
    return null;
}

public static Set&lt;Student&gt; getStudentsWithModule(final Set&lt;Student&gt; students, final Module module) {
    final Set&lt;Student&gt; result = new LinkedHashSet&lt;Student&gt;();
    for (final Student student: students) {
        if (student.hasModule(module)) {
            result.add(student);
        }
    }
    return result;
}

private static void printStudents(final Set&lt;Student&gt; students) {
    for (final Student student: students) {
        System.out.print(student.getName());
        System.out.print(" ");
    }
}

I'd create a StudentManager and a ModuleManager class. searchModule should be in the ModuleManager and it should use its internal Set&lt;Module&gt; modules field instead of the method parameter. The same is true for the getStudentsWithModule method: it should be inside the StudentManager class and it should use its internal Set&lt;Student&gt; students field instead of the method parameter. It results high cohesion.

Once you have these classes, remove the static modifier of the methods.
Check your input: check for nulls, empty Strings etc. and throw proper exceptions (usually NullPointerException or IllegalArgumentException) with a helpful message:

public static Set&lt;Student&gt; getStudentsWithModule(final Set&lt;Student&gt; students, final Module module) {
    if (students == null ) {
        throw new NullPointerException("students cannot be null");
    }
    if (module == null) {
        throw new NullPointerException("module cannot be null");
    }
    ...
}