PipelineJobFilters { public static boolean isPullRequest(Item item) { return SCMHead.HeadByItem.findHead(item) instanceof ChangeRequestSCMHead; }  static boolean isPullRequest(Item item);  }
@Test public void testIsPullRequest(){ BlueOrganization organization = mockOrganization(); OrganizationFolder organizationFolder = mockOrgFolder(organization); PullRequestSCMHead changeRequestSCMHead = mock(PullRequestSCMHead.class); mockStatic(SCMHead.HeadByItem.class); when(SCMHead.HeadByItem.findHead(organizationFolder)).thenReturn(changeRequestSCMHead); assertTrue(PipelineJobFilters.isPullRequest(organizationFolder)); assertFalse(new PipelineJobFilters.OriginFilter().getFilter().apply(organizationFolder)); assertTrue(new PipelineJobFilters.PullRequestFilter().getFilter().apply(organizationFolder)); }