public List<Uuid> directoryDifference(List<Uuid> otherDirectories) {
        List<Uuid> results = new ArrayList<>();
        for (Uuid directory : directories) {
            if (!otherDirectories.contains(directory)) {
                results.add(directory);
            }
        }
        return results;
    }
An immutable class which represents broker registrations.
metadata/src/main/java/org/apache/kafka/metadata/BrokerRegistration.java