public Optional<HostFailurePath> worstCaseHostLossLeadingToFailure() {
        Map<Node, Integer> timesNodeCanBeRemoved = computeMaximalRepeatedRemovals();
        return greedyHeuristicFindFailurePath(timesNodeCanBeRemoved);
    }
@Test
    public void testEdgeCaseFailurePaths() {
        {
            CapacityCheckerTester tester = new CapacityCheckerTester();
            tester.createNodes(1, 1,
                               0, new NodeResources(1, 10, 100, 1), 10,
                               0, new NodeResources(1, 10, 100, 1), 10);
            var failurePath = tester.capacityChecker.worstCaseHostLossLeadingToFailure();
            assertFalse("Computing worst case host loss with no hosts should return an empty optional.", failurePath.isPresent());
        }

        // Odd edge case that should never be able to occur in prod
        {
            CapacityCheckerTester tester = new CapacityCheckerTester();
            tester.createNodes(1, 10,
                               10, new NodeResources(10, 1000, 10000, 1), 100,
                               1, new NodeResources(10, 1000, 10000, 1), 100);
            var failurePath = tester.capacityChecker.worstCaseHostLossLeadingToFailure();
            assertTrue(failurePath.isPresent());
            assertTrue("Computing worst case host loss if all hosts have to be removed should result in an non-empty failureReason with empty nodes.",
                       failurePath.get().failureReason.tenant.isEmpty() && failurePath.get().failureReason.host.isEmpty());
            assertEquals(tester.nodeRepository.nodes().list().nodeType(NodeType.host).size(), failurePath.get().hostsCausingFailure.size());
        }

        {
            CapacityCheckerTester tester = new CapacityCheckerTester();
            tester.createNodes(3, 30,
                               10, new NodeResources(0, 0, 10000, 1), 1000,
                               0, new NodeResources(0, 0, 0, 0), 0);
            var failurePath = tester.capacityChecker.worstCaseHostLossLeadingToFailure();
            assertTrue(failurePath.isPresent());
            if (failurePath.get().failureReason.tenant.isPresent()) {
                var failureReasons = failurePath.get().failureReason.allocationFailures;
                assertEquals("When there are multiple lacking resources, all failures are multipleReasonFailures",
                             failureReasons.size(), failureReasons.multipleReasonFailures().size());
                assertEquals(0, failureReasons.singularReasonFailures().size());
            }
            else {
                fail();
            }
        }
    }