CurrentBranchProducer { @Produces @Customizable public CurrentBranch currentBranchProducer() { if (this.currentBranch.isUnsatisfied()) { return new DefaultCurrentBranch(); } return this.currentBranch.get(); }  @Produces @Customizable CurrentBranch currentBranchProducer();  }
@Test public void testCurrentBranchProducerWhenUnsatisfied() { Mockito.when(currentBranch.isUnsatisfied()).thenReturn(true); CurrentBranch currentBranch = currentBranchProducer.currentBranchProducer(); Assert.assertNotNull(currentBranch); Assert.assertEquals(new DefaultCurrentBranch().getName(), currentBranch.getName()); }