@Override
    public int compareTo(RestartRequest o) {
        int result = connectorName.compareTo(o.connectorName);
        return result == 0 ? impactRank() - o.impactRank() : result;
    }
@Test
    public void compareImpact() {
        RestartRequest onlyFailedConnector = new RestartRequest(CONNECTOR_NAME, true, false);
        RestartRequest failedConnectorAndTasks = new RestartRequest(CONNECTOR_NAME, true, true);
        RestartRequest onlyConnector = new RestartRequest(CONNECTOR_NAME, false, false);
        RestartRequest connectorAndTasks = new RestartRequest(CONNECTOR_NAME, false, true);
        List<RestartRequest> restartRequests = Arrays.asList(connectorAndTasks, onlyConnector, onlyFailedConnector, failedConnectorAndTasks);
        Collections.sort(restartRequests);
        assertEquals(onlyFailedConnector, restartRequests.get(0));
        assertEquals(failedConnectorAndTasks, restartRequests.get(1));
        assertEquals(onlyConnector, restartRequests.get(2));
        assertEquals(connectorAndTasks, restartRequests.get(3));

        RestartRequest onlyFailedDiffConnector = new RestartRequest(CONNECTOR_NAME + "foo", true, false);
        assertTrue(onlyFailedConnector.compareTo(onlyFailedDiffConnector) != 0);
    }