@Test
public void testRuleUpdateWithInvalidation() {

    SamplingRule input = createInput("r1", 300, 10, 0.0)
            .withHTTPMethod("POST")
            .withServiceName("s1")
            .withURLPath("/foo/bar");
    CentralizedRule r = new CentralizedRule(input, new RandImpl());
    SamplingRule update = createInput("r1", 301, 5, 0.5)
            .withHTTPMethod("GET")
            .withServiceName("s2")
            .withURLPath("/bar/foo");
    boolean invalidate = r.update(update);
    Matchers m = Whitebox.getInternalState(r, "matchers", CentralizedRule.class);
    Assert.assertEquals("GET", Whitebox.getInternalState(m, "method", Matchers.class));
    Assert.assertEquals("s2", Whitebox.getInternalState(m, "service", Matchers.class));
    Assert.assertEquals("/bar/foo", Whitebox.getInternalState(m, "url", Matchers.class));
    Assert.assertTrue(invalidate);
}