@Test public void toAndFromIgnoringResource() { EntityFilter entityFilter = new SimpleEntityFilter(ROMEO_CAR, EntityFilter.Type.TO_AND_FROM, true); InMemoryEntityFilter tested = new InMemoryEntityFilter(entityFilter); assertTrue(tested.test(romeoSidewalkToRomeoCar)); assertFalse(tested.test(romeoSidewalkToJulietBalcony)); }
@Override public boolean test(ArchivedMessage message) { EntityFilter.Type type = filter.type(); if (type == EntityFilter.Type.TO_AND_FROM) { return matchToAndFrom(message); } else if (type == EntityFilter.Type.TO_OR_FROM) { return matchToOrFrom(message); } else { throw new IllegalArgumentException("Unexpected entity filter type '" + type + "'"); } }
InMemoryEntityFilter implements Predicate<ArchivedMessage> { @Override public boolean test(ArchivedMessage message) { EntityFilter.Type type = filter.type(); if (type == EntityFilter.Type.TO_AND_FROM) { return matchToAndFrom(message); } else if (type == EntityFilter.Type.TO_OR_FROM) { return matchToOrFrom(message); } else { throw new IllegalArgumentException("Unexpected entity filter type '" + type + "'"); } } }
InMemoryEntityFilter implements Predicate<ArchivedMessage> { @Override public boolean test(ArchivedMessage message) { EntityFilter.Type type = filter.type(); if (type == EntityFilter.Type.TO_AND_FROM) { return matchToAndFrom(message); } else if (type == EntityFilter.Type.TO_OR_FROM) { return matchToOrFrom(message); } else { throw new IllegalArgumentException("Unexpected entity filter type '" + type + "'"); } } InMemoryEntityFilter(EntityFilter filter); }
InMemoryEntityFilter implements Predicate<ArchivedMessage> { @Override public boolean test(ArchivedMessage message) { EntityFilter.Type type = filter.type(); if (type == EntityFilter.Type.TO_AND_FROM) { return matchToAndFrom(message); } else if (type == EntityFilter.Type.TO_OR_FROM) { return matchToOrFrom(message); } else { throw new IllegalArgumentException("Unexpected entity filter type '" + type + "'"); } } InMemoryEntityFilter(EntityFilter filter); @Override boolean test(ArchivedMessage message); }
InMemoryEntityFilter implements Predicate<ArchivedMessage> { @Override public boolean test(ArchivedMessage message) { EntityFilter.Type type = filter.type(); if (type == EntityFilter.Type.TO_AND_FROM) { return matchToAndFrom(message); } else if (type == EntityFilter.Type.TO_OR_FROM) { return matchToOrFrom(message); } else { throw new IllegalArgumentException("Unexpected entity filter type '" + type + "'"); } } InMemoryEntityFilter(EntityFilter filter); @Override boolean test(ArchivedMessage message);  }