@Test
public void testFilterWithVersion() throws Exception {

  ServiceContext sc = new MockRunningServiceContext(rule,
      TestServiceManager.createBaseDef("service"));
  GetCompInstancesRequestProto.Builder reqBuilder =
      GetCompInstancesRequestProto.newBuilder();
  reqBuilder.setVersion("v2");
  Assert.assertEquals("num comps", 0,
      FilterUtils.filterInstances(sc, reqBuilder.build()).size());
  reqBuilder.addAllComponentNames(Lists.newArrayList("compa"))
      .setVersion("v1").build();
  Assert.assertEquals("num containers", 2,
      FilterUtils.filterInstances(sc, reqBuilder.build()).get(0)
          .getContainers().size());
}