@Test public void testMatches() { NoteData note = new NoteData(); note.setId(new Random().nextLong()); Matcher<NoteData> matcher = new NoteIdMatcher(null); Assert.assertTrue(matcher.matches(note)); matcher = new NoteIdMatcher(note.getId() + 1); Assert.assertFalse(matcher.matches(note)); matcher = new NoteIdMatcher(note.getId()); Assert.assertTrue(matcher.matches(note)); }
@Override public boolean matches(NoteData entity) { return noteId == null || entity.getId().equals(noteId); }
NoteIdMatcher extends Matcher<NoteData> { @Override public boolean matches(NoteData entity) { return noteId == null || entity.getId().equals(noteId); } }
NoteIdMatcher extends Matcher<NoteData> { @Override public boolean matches(NoteData entity) { return noteId == null || entity.getId().equals(noteId); } NoteIdMatcher(Long noteId); }
NoteIdMatcher extends Matcher<NoteData> { @Override public boolean matches(NoteData entity) { return noteId == null || entity.getId().equals(noteId); } NoteIdMatcher(Long noteId); @Override boolean matches(NoteData entity); }
NoteIdMatcher extends Matcher<NoteData> { @Override public boolean matches(NoteData entity) { return noteId == null || entity.getId().equals(noteId); } NoteIdMatcher(Long noteId); @Override boolean matches(NoteData entity);  }