Source:
public void updatedBySelfAndOther(){ LocalDateTime now = LocalDateTime.now(); Qualifier.setCurrentTime(now); TurboIssue issueUpdated = new TurboIssue(REPO, 1, ""); IssueMetadata updatedByOtherMetadata = new IssueMetadata(issueUpdated.getMetadata(), now.minusHours(4), now.minusHours(4), 2, 2, true, false); issueUpdated.setMetadata(updatedByOtherMetadata); assertEquals(false, matches("updatedByOthers:<2", issueUpdated)); assertEquals(false, matches("updatedBySelf:<2", issueUpdated)); assertEquals(true, matches("updatedByOthers:<5", issueUpdated)); assertEquals(false, matches("updatedBySelf:<5", issueUpdated)); IssueMetadata updatedBySelfAndOtherMetadata = new IssueMetadata(issueUpdated.getMetadata(), now.minusHours(4), now.minusHours(4), 2, 2, true, true); issueUpdated.setMetadata(updatedBySelfAndOtherMetadata); assertEquals(false, matches("updatedByOthers:<2", issueUpdated)); assertEquals(false, matches("updatedBySelf:<2", issueUpdated)); assertEquals(true, matches("updatedByOthers:<5", issueUpdated)); assertEquals(true, matches("updatedBySelf:<5", issueUpdated)); IssueMetadata updatedBySelfMetadata = new IssueMetadata(issueUpdated.getMetadata(), now.minusHours(4), now.minusHours(4), 2, 2, false, true); issueUpdated.setMetadata(updatedBySelfMetadata); assertEquals(false, matches("updatedByOthers:<2", issueUpdated)); assertEquals(false, matches("updatedBySelf:<2", issueUpdated)); assertEquals(false, matches("updatedByOthers:<5", issueUpdated)); assertEquals(true, matches("updatedBySelf:<5", issueUpdated)); IssueMetadata updatedByNoneMetadata = new IssueMetadata(issueUpdated.getMetadata(), now.minusHours(4), now.minusHours(4), 2, 2, false, false); issueUpdated.setMetadata(updatedByNoneMetadata); assertEquals(false, matches("updatedByOthers:<2", issueUpdated)); assertEquals(false, matches("updatedBySelf:<2", issueUpdated)); assertEquals(false, matches("updatedByOthers:<5", issueUpdated)); assertEquals(false, matches("updatedBySelf:<5", issueUpdated)); }

Target:
public void updatedBySelfAndOther(){ LocalDateTime now = LocalDateTime.now(); Qualifier.setCurrentTime(now); TurboIssue issueUpdated = new TurboIssue(REPO, 1, ""); IssueMetadata updatedByOtherMetadata = new IssueMetadata(issueUpdated.getMetadata(), now.minusHours(4), now.minusHours(4), 2, 2, true, false); issueUpdated.setMetadata(updatedByOtherMetadata); assertEquals(false, matches("updated-others:<2", issueUpdated)); assertEquals(false, matches("updated-self:<2", issueUpdated)); assertEquals(true, matches("updated-others:<=4", issueUpdated)); assertEquals(false, matches("updated-self:<=4", issueUpdated)); IssueMetadata updatedBySelfAndOtherMetadata = new IssueMetadata(issueUpdated.getMetadata(), now.minusHours(4), now.minusHours(4), 2, 2, true, true); issueUpdated.setMetadata(updatedBySelfAndOtherMetadata); assertEquals(false, matches("updated-others:<2", issueUpdated)); assertEquals(false, matches("updated-self:<2", issueUpdated)); assertEquals(true, matches("updated-others:<=4", issueUpdated)); assertEquals(true, matches("updated-self:<=4", issueUpdated)); IssueMetadata updatedBySelfMetadata = new IssueMetadata(issueUpdated.getMetadata(), now.minusHours(4), now.minusHours(4), 2, 2, false, true); issueUpdated.setMetadata(updatedBySelfMetadata); assertEquals(false, matches("updated-others:<2", issueUpdated)); assertEquals(false, matches("updated-self:<2", issueUpdated)); assertEquals(false, matches("updated-others:<=4", issueUpdated)); assertEquals(true, matches("updated-self:<=4", issueUpdated)); IssueMetadata updatedByNoneMetadata = new IssueMetadata(issueUpdated.getMetadata(), now.minusHours(4), now.minusHours(4), 2, 2, false, false); issueUpdated.setMetadata(updatedByNoneMetadata); assertEquals(false, matches("updated-others:<2", issueUpdated)); assertEquals(false, matches("updated-self:<2", issueUpdated)); assertEquals(false, matches("updated-others:<=4", issueUpdated)); assertEquals(false, matches("updated-self:<=4", issueUpdated)); }