public static boolean areLocalAssignmentsEquivalent(LocalAssignment first, LocalAssignment second) {
        if (first == null && second == null) {
            return true;
        }
        if (first != null && second != null) {
            if (first.get_topology_id().equals(second.get_topology_id())) {
                Set<ExecutorInfo> aexec = new HashSet<>(first.get_executors());
                Set<ExecutorInfo> bexec = new HashSet<>(second.get_executors());
                if (aexec.equals(bexec)) {
                    boolean firstHasResources = first.is_set_resources();
                    boolean secondHasResources = second.is_set_resources();
                    if (!firstHasResources && !secondHasResources) {
                        return true;
                    }
                    if (firstHasResources && secondHasResources) {
                        WorkerResources firstResources = first.get_resources();
                        WorkerResources secondResources = second.get_resources();
                        return customWorkerResourcesEquality(firstResources, secondResources);
                    }
                }
            }
        }
        return false;
    }
@Test
    public void testEquivalent() {
        LocalAssignment a = mkLocalAssignment("A", mkExecutorInfoList(1, 2, 3, 4, 5), mkWorkerResources(100.0, 100.0, 100.0));
        LocalAssignment aResized = mkLocalAssignment("A", mkExecutorInfoList(1, 2, 3, 4, 5), mkWorkerResources(100.0, 200.0, 100.0));
        LocalAssignment b = mkLocalAssignment("B", mkExecutorInfoList(1, 2, 3, 4, 5, 6), mkWorkerResources(100.0, 100.0, 100.0));
        LocalAssignment bReordered = mkLocalAssignment("B", mkExecutorInfoList(6, 5, 4, 3, 2, 1), mkWorkerResources(100.0, 100.0, 100.0));

        LocalAssignment c = mkLocalAssignment("C", mkExecutorInfoList(188, 261),mkWorkerResources(400.0,10000.0,0.0));

        WorkerResources workerResources = mkWorkerResources(400.0, 10000.0, 0.0);
        Map<String, Double> additionalResources = workerResources.get_resources();
        if( additionalResources == null) additionalResources = new HashMap<>();
        additionalResources.put("network.resource.units", 0.0);

        workerResources.set_resources(additionalResources);
        LocalAssignment cReordered = mkLocalAssignment("C", mkExecutorInfoList(188, 261), workerResources);

        assertTrue(EquivalenceUtils.areLocalAssignmentsEquivalent(c,cReordered));
        assertTrue(EquivalenceUtils.areLocalAssignmentsEquivalent(null, null));
        assertTrue(EquivalenceUtils.areLocalAssignmentsEquivalent(a, a));
        assertTrue(EquivalenceUtils.areLocalAssignmentsEquivalent(b, bReordered));
        assertTrue(EquivalenceUtils.areLocalAssignmentsEquivalent(bReordered, b));

        assertFalse(EquivalenceUtils.areLocalAssignmentsEquivalent(a, aResized));
        assertFalse(EquivalenceUtils.areLocalAssignmentsEquivalent(aResized, a));
        assertFalse(EquivalenceUtils.areLocalAssignmentsEquivalent(a, null));
        assertFalse(EquivalenceUtils.areLocalAssignmentsEquivalent(null, b));
        assertFalse(EquivalenceUtils.areLocalAssignmentsEquivalent(a, b));
    }