### Question:
ActionWorkItemSetFieldPlugin extends BaseDecisionTableColumnPlugin implements HasFieldPage,
                                                                                           HasPatternPage,
                                                                                           HasWorkItemPage,
                                                                                           HasAdditionalInfoPage { @Override public Set<PatternWrapper> getPatterns() { final Set<PatternWrapper> patterns = new HashSet<>(); if (isNewColumn() || !isNewFactPattern()) { final BRLRuleModel brlRuleModel = new BRLRuleModel(presenter.getModel()); final List<String> variables = brlRuleModel.getLHSPatternVariables(); variables.forEach(var -> { final String factType = brlRuleModel.getLHSBoundFact(var).getFactType(); final boolean isNegated = brlRuleModel.getLHSBoundFact(var).isNegated(); patterns.add(new PatternWrapper(factType, var, isNegated)); }); } if (isNewColumn() || isNewFactPattern()) { final BRLRuleModel brlRuleModel = new BRLRuleModel(presenter.getModel()); final List<String> variables = brlRuleModel.getRHSBoundFacts(); variables.forEach(var -> { final String factType = brlRuleModel.getRHSBoundFact(var).getFactType(); patterns.add(new PatternWrapper(factType, var)); }); } return patterns; } @Inject  ActionWorkItemSetFieldPlugin(final PatternPage patternPage,
                                        final FieldPage fieldPage,
                                        final AdditionalInfoPage additionalInfoPage,
                                        final WorkItemPage workItemPage,
                                        final Event<WizardPageStatusChangeEvent> changeEvent,
                                        final TranslationService translationService); @Override void init(final NewGuidedDecisionTableColumnWizard wizard); @Override String getWorkItem(); @Override void setWorkItem(final String workItemKey); @Override ActionCol52 editingCol(); @Override Boolean isWorkItemSet(); @Override PortableWorkDefinition getWorkItemDefinition(); @Override void forEachWorkItem(BiConsumer<String, String> biConsumer); @Override void setWorkItemPageAsCompleted(); @Override String getHeader(); @Override void setHeader(final String header); @Override Set<String> getAlreadyUsedColumnHeaders(); @Override boolean isHideColumn(); @Override void setHideColumn(boolean hideColumn); @Override void setInsertLogical(final Boolean isInsertLogical); @Override void setUpdate(final Boolean isUpdate); @Override String getTitle(); @Override List<WizardPage> getPages(); @Override Boolean generateColumn(); @Override PatternWrapper patternWrapper(); @Override void setEditingPattern(final PatternWrapper patternWrapper); @Override String getEntryPointName(); @Override void setEntryPointName(final String entryPointName); @Override String getPatternPageDescription(); @Override Set<PatternWrapper> getPatterns(); @Override int constraintValue(); @Override FieldAccessorsAndMutators getAccessor(); @Override boolean filterEnumFields(); @Override boolean isFieldBindingValid(); @Override String getBinding(); @Override void setBinding(final String binding); @Override boolean isBindable(); @Override String getFactField(); @Override void setFactField(final String selectedValue); @Override boolean showUpdateEngineWithChanges(); @Override boolean showLogicallyInsert(); @Override boolean isLogicallyInsert(); @Override boolean isUpdateEngine(); @Override Type getType();  }### Answer:
@Test public void testGetPatternsWhenColumnIsNew() throws Exception { mockPatterns(); doReturn(true).when(plugin).isNewColumn(); final Set<PatternWrapper> patterns = plugin.getPatterns(); assertEquals(2, patterns.size()); assertTrue(patterns.contains(new PatternWrapper("factType", "boundName", true))); assertTrue(patterns.contains(new PatternWrapper("factType", "boundName"))); }