@Test public void match() { DocumentReference alice = new DocumentReference("wiki", "Users", "Alice"); DocumentReference bob = new DocumentReference("wiki", "Users", "Bob"); Assert.assertFalse(new DocumentRollingBackEvent().matches(new DocumentRolledBackEvent())); Assert.assertTrue(new DocumentRollingBackEvent().matches(new DocumentRollingBackEvent())); Assert.assertTrue(new DocumentRollingBackEvent().matches(new DocumentRollingBackEvent(alice, "2.3"))); Assert.assertFalse(new DocumentRollingBackEvent(bob).matches(new DocumentRollingBackEvent(alice, "1.5"))); Assert.assertTrue(new DocumentRollingBackEvent(bob).matches(new DocumentRollingBackEvent(bob, "4.2"))); Assert.assertFalse(new DocumentRollingBackEvent(bob, "3.1").matches(new DocumentRollingBackEvent(bob))); Assert.assertFalse(new DocumentRollingBackEvent(bob, "7.6").matches(new DocumentRollingBackEvent(bob, "7.5"))); Assert.assertTrue(new DocumentRollingBackEvent(bob, "5.8").matches(new DocumentRollingBackEvent(bob, "5.8"))); Assert .assertFalse(new DocumentRollingBackEvent(bob, "1.0").matches(new DocumentRollingBackEvent(alice, "1.0"))); }
@Override public boolean matches(Object otherEvent) { boolean matches = super.matches(otherEvent); if (matches) { DocumentRollingBackEvent documentRollingBackEvent = (DocumentRollingBackEvent) otherEvent; matches = revision == null || revision.equals(documentRollingBackEvent.getRevision()); } return matches; }
DocumentRollingBackEvent extends AbstractDocumentEvent { @Override public boolean matches(Object otherEvent) { boolean matches = super.matches(otherEvent); if (matches) { DocumentRollingBackEvent documentRollingBackEvent = (DocumentRollingBackEvent) otherEvent; matches = revision == null || revision.equals(documentRollingBackEvent.getRevision()); } return matches; } }
DocumentRollingBackEvent extends AbstractDocumentEvent { @Override public boolean matches(Object otherEvent) { boolean matches = super.matches(otherEvent); if (matches) { DocumentRollingBackEvent documentRollingBackEvent = (DocumentRollingBackEvent) otherEvent; matches = revision == null || revision.equals(documentRollingBackEvent.getRevision()); } return matches; } DocumentRollingBackEvent();  DocumentRollingBackEvent(DocumentReference documentReference);  DocumentRollingBackEvent(DocumentReference documentReference, String revision);  DocumentRollingBackEvent(EventFilter eventFilter); }
DocumentRollingBackEvent extends AbstractDocumentEvent { @Override public boolean matches(Object otherEvent) { boolean matches = super.matches(otherEvent); if (matches) { DocumentRollingBackEvent documentRollingBackEvent = (DocumentRollingBackEvent) otherEvent; matches = revision == null || revision.equals(documentRollingBackEvent.getRevision()); } return matches; } DocumentRollingBackEvent();  DocumentRollingBackEvent(DocumentReference documentReference);  DocumentRollingBackEvent(DocumentReference documentReference, String revision);  DocumentRollingBackEvent(EventFilter eventFilter); String getRevision(); @Override boolean matches(Object otherEvent); }
DocumentRollingBackEvent extends AbstractDocumentEvent { @Override public boolean matches(Object otherEvent) { boolean matches = super.matches(otherEvent); if (matches) { DocumentRollingBackEvent documentRollingBackEvent = (DocumentRollingBackEvent) otherEvent; matches = revision == null || revision.equals(documentRollingBackEvent.getRevision()); } return matches; } DocumentRollingBackEvent();  DocumentRollingBackEvent(DocumentReference documentReference);  DocumentRollingBackEvent(DocumentReference documentReference, String revision);  DocumentRollingBackEvent(EventFilter eventFilter); String getRevision(); @Override boolean matches(Object otherEvent);  }