@Test
public void testFilter() {

  FakeIdeProfilerServices ideServices = new FakeIdeProfilerServices();
  ideServices.addProjectClasses("my.foo.bar", "your.bar.foo");
  String matchedClass = "my.foo.bar";
  String matchedInnerClass = "your.bar.foo$1";
  String mismatchedClass = "my.bar";
  String mismatchedInnerClass = "your.foo$1";
  FakeCaptureObject capture = new FakeCaptureObject.Builder().build();
  FakeInstanceObject matchedClassInstance = new FakeInstanceObject.Builder(capture, 1, matchedClass).build();
  FakeInstanceObject matchedInnerClassInstance = new FakeInstanceObject.Builder(capture, 2, matchedInnerClass).build();
  FakeInstanceObject mismatchedClassInstance = new FakeInstanceObject.Builder(capture, 3, mismatchedClass).build();
  FakeInstanceObject mismatchedInnerClassInstance = new FakeInstanceObject.Builder(capture, 4, mismatchedInnerClass).build();
  Set<InstanceObject> instances = ImmutableSet.of(matchedClassInstance,
                                                  matchedInnerClassInstance,
                                                  mismatchedClassInstance,
                                                  mismatchedInnerClassInstance);
  ProjectClassesInstanceFilter filter = new ProjectClassesInstanceFilter(ideServices);
  Set<InstanceObject> result = filter.filter(instances, capture.getClassDatabase());
  assertThat(result).containsExactly(matchedClassInstance, matchedInnerClassInstance);
}