@Test public void buildWorksIfPatientEmpty() { final Patient patient = mock(Patient.class); Assert.assertEquals(Collections.emptySet(), patient.getFeatures()); final GenePanel genePanel = this.genePanelFactory.build(patient); Assert.assertEquals(0, genePanel.size()); Assert.assertTrue(genePanel.getPresentTerms().isEmpty()); Assert.assertTrue(genePanel.getAbsentTerms().isEmpty()); Assert.assertTrue(genePanel.getTermsForGeneList().isEmpty()); Assert.assertNull(genePanel.getMatchCounts()); final JSONObject expectedJson = new JSONObject().put(SIZE_LABEL, 0).put(TOTAL_SIZE_LABEL, 0) .put(GENE_ROWS_LABEL, new JSONArray()); Assert.assertTrue(genePanel.toJSON().similar(expectedJson)); }
@Override public GenePanel build( @Nonnull final Collection<VocabularyTerm> presentTerms, @Nonnull final Collection<VocabularyTerm> absentTerms) { Validate.notNull(presentTerms); Validate.notNull(absentTerms); return new DefaultGenePanelImpl(presentTerms, absentTerms, this.generateMatchCount, this.vocabularyManager); }
DefaultGenePanelFactoryImpl implements GenePanelFactory { @Override public GenePanel build( @Nonnull final Collection<VocabularyTerm> presentTerms, @Nonnull final Collection<VocabularyTerm> absentTerms) { Validate.notNull(presentTerms); Validate.notNull(absentTerms); return new DefaultGenePanelImpl(presentTerms, absentTerms, this.generateMatchCount, this.vocabularyManager); } }
DefaultGenePanelFactoryImpl implements GenePanelFactory { @Override public GenePanel build( @Nonnull final Collection<VocabularyTerm> presentTerms, @Nonnull final Collection<VocabularyTerm> absentTerms) { Validate.notNull(presentTerms); Validate.notNull(absentTerms); return new DefaultGenePanelImpl(presentTerms, absentTerms, this.generateMatchCount, this.vocabularyManager); }  }
DefaultGenePanelFactoryImpl implements GenePanelFactory { @Override public GenePanel build( @Nonnull final Collection<VocabularyTerm> presentTerms, @Nonnull final Collection<VocabularyTerm> absentTerms) { Validate.notNull(presentTerms); Validate.notNull(absentTerms); return new DefaultGenePanelImpl(presentTerms, absentTerms, this.generateMatchCount, this.vocabularyManager); }  @Override GenePanelFactory withMatchCount(final boolean generate); @Override GenePanel build(
        @Nonnull final Collection<VocabularyTerm> presentTerms,
        @Nonnull final Collection<VocabularyTerm> absentTerms); @Override GenePanel build(
        @Nonnull final Collection<VocabularyTerm> presentTerms,
        @Nonnull final Collection<VocabularyTerm> absentTerms,
        @Nonnull final Collection<VocabularyTerm> rejectedGenes); @Override GenePanel build(@Nonnull final Patient patient); @Override GenePanel build(@Nonnull final Patient patient, final boolean excludeRejectedGenes); }
DefaultGenePanelFactoryImpl implements GenePanelFactory { @Override public GenePanel build( @Nonnull final Collection<VocabularyTerm> presentTerms, @Nonnull final Collection<VocabularyTerm> absentTerms) { Validate.notNull(presentTerms); Validate.notNull(absentTerms); return new DefaultGenePanelImpl(presentTerms, absentTerms, this.generateMatchCount, this.vocabularyManager); }  @Override GenePanelFactory withMatchCount(final boolean generate); @Override GenePanel build(
        @Nonnull final Collection<VocabularyTerm> presentTerms,
        @Nonnull final Collection<VocabularyTerm> absentTerms); @Override GenePanel build(
        @Nonnull final Collection<VocabularyTerm> presentTerms,
        @Nonnull final Collection<VocabularyTerm> absentTerms,
        @Nonnull final Collection<VocabularyTerm> rejectedGenes); @Override GenePanel build(@Nonnull final Patient patient); @Override GenePanel build(@Nonnull final Patient patient, final boolean excludeRejectedGenes);  }