FactPatternConstraintsPage extends AbstractGuidedDecisionTableWizardPage implements
        FactPatternConstraintsPageView.Presenter { @Override public void getOperatorCompletions(final Pattern52 selectedPattern, final ConditionCol52 selectedCondition, final Callback<String[]> callback) { final String factType = selectedPattern.getFactType(); final String factField = selectedCondition.getFactField(); this.oracle.getOperatorCompletions(factType, factField, new Callback<String[]>() { @Override public void callback(final String[] ops) { final List<String> filteredOps = new ArrayList<String>(); for (String op : ops) { filteredOps.add(op); } if (BaseSingleFieldConstraint.TYPE_LITERAL != selectedCondition.getConstraintValueType()) { filteredOps.remove("in"); filteredOps.remove("not in"); } final String[] displayOps = new String[filteredOps.size()]; filteredOps.toArray(displayOps); callback.callback(displayOps); } }); }  @Override String getTitle(); @Override void initialise(); @Override void prepareView(); @Override void isComplete(final Callback<Boolean> callback); void onDuplicatePatterns(final @Observes DuplicatePatternsEvent event); void onConditionsDefined(final @Observes ConditionsDefinedEvent event); @Override void selectPattern(final Pattern52 pattern); @Override void setChosenConditions(final Pattern52 pattern,
                                    final List<ConditionCol52> conditions); @Override void getOperatorCompletions(final Pattern52 selectedPattern,
                                       final ConditionCol52 selectedCondition,
                                       final Callback<String[]> callback); @Override GuidedDecisionTable52.TableFormat getTableFormat(); @Override boolean hasEnum(final Pattern52 selectedPattern,
                           final ConditionCol52 selectedCondition); @Override boolean requiresValueList(final Pattern52 selectedPattern,
                                     final ConditionCol52 selectedCondition); @Override void assertDefaultValue(final Pattern52 selectedPattern,
                                   final ConditionCol52 selectedCondition); @Override void stateChanged();  }
@Test public void testGetOperatorCompletionsLiteral() throws Exception { when(conditionCol.getConstraintValueType()).thenReturn(BaseSingleFieldConstraint.TYPE_LITERAL); Callback<String[]> callback = mock(Callback.class); page.getOperatorCompletions(pattern, conditionCol, callback); verify(callback).callback(new String[]{"==", "!=", "<", ">", "<=", ">=", "matches", "not matches", "soundslike", "not soundslike", "== null", "!= null", "in", "not in"}); }
@Test public void testGetOperatorCompletionsPredicate() throws Exception { when(conditionCol.getConstraintValueType()).thenReturn(BaseSingleFieldConstraint.TYPE_PREDICATE); Callback<String[]> callback = mock(Callback.class); page.getOperatorCompletions(pattern, conditionCol, callback); verify(callback).callback(new String[]{"==", "!=", "<", ">", "<=", ">=", "matches", "not matches", "soundslike", "not soundslike", "== null", "!= null"}); }