test_class.declarator: suggestionEngine = new SimpleSuggestionEngine()
test_class.modifier: private final
test_class.original_string: private final SimpleSuggestionEngine suggestionEngine = new SimpleSuggestionEngine();
test_class.type: SimpleSuggestionEngine
test_class.var_name: suggestionEngine
test_class.declarator: actionRegistry
test_class.modifier: private
test_class.original_string: private ActionRegistry actionRegistry;
test_class.type: ActionRegistry
test_class.var_name: actionRegistry
test_class.file: dataprep-transformation/src/test/java/org/talend/dataprep/transformation/api/transformer/suggestion/SimpleSuggestionEngineTest.java
test_class.identifier: SimpleSuggestionEngineTest
test_case.body: @Test
      public void shouldSuggestionsShouldBeSorted() throws IOException {
  
          final String json = IOUtils.toString(this.getClass().getResourceAsStream("sample_column.json"), UTF_8);
          ObjectMapper mapper = new ObjectMapper();
          final ColumnMetadata columnMetadata = mapper.readValue(json, ColumnMetadata.class);
  
          List<ActionDefinition> actions = new ArrayList<>();
          actions.add(new FillIfEmpty());
          actions.add(new FillInvalid());
          actions.add(new DeleteInvalid());
          actions.add(new DeleteEmpty());
          actions.add(new Absolute());
          actions.add(new UpperCase());
          final Stream<Suggestion> suggestions = suggestionEngine.score(actions.stream(), columnMetadata);
  
          int currentScore = Integer.MAX_VALUE;
          for (Suggestion suggestion : suggestions.collect(Collectors.toList())) {
              assertTrue(currentScore >= suggestion.getScore());
              currentScore = suggestion.getScore();
          }
      }
test_case.class_method_signature: SimpleSuggestionEngineTest.shouldSuggestionsShouldBeSorted()
test_case.full_signature: @Test public void shouldSuggestionsShouldBeSorted()
test_case.identifier: shouldSuggestionsShouldBeSorted
test_case.invocations: toString getResourceAsStream getClass readValue add add add add add add score stream collect toList assertTrue getScore getScore
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldSuggestionsShouldBeSorted()
focal_class.declarator: SUGGESTION_COMPARATOR =
              (s1, s2) -> Integer.compare(s2.getScore(), s1.getScore())
focal_class.modifier: private static final
focal_class.original_string: private static final Comparator<Suggestion> SUGGESTION_COMPARATOR =
              (s1, s2) -> Integer.compare(s2.getScore(), s1.getScore());
focal_class.type: Comparator<Suggestion>
focal_class.var_name: SUGGESTION_COMPARATOR
focal_class.declarator: rules = new ArrayList<>()
focal_class.modifier: @Autowired(required = false)
      private
focal_class.original_string: @Autowired(required = false)
      private List<SuggestionEngineRule> rules = new ArrayList<>();
focal_class.type: List<SuggestionEngineRule>
focal_class.var_name: rules
focal_class.file: dataprep-transformation/src/main/java/org/talend/dataprep/transformation/api/transformer/suggestion/SimpleSuggestionEngine.java
focal_class.identifier: SimpleSuggestionEngine
focal_class.interfaces: implements SuggestionEngine
focal_class.class_method_signature: SimpleSuggestionEngine.setRules(List<SuggestionEngineRule> rules)
focal_class.full_signature: public void setRules(List<SuggestionEngineRule> rules)
focal_class.identifier: setRules
focal_class.modifiers: public
focal_class.parameters: (List<SuggestionEngineRule> rules)
focal_class.return: void
focal_class.signature: void setRules(List<SuggestionEngineRule> rules)
focal_class.class_method_signature: SimpleSuggestionEngine.score(Stream<ActionDefinition> actions, ColumnMetadata column)
focal_class.full_signature: @Override public Stream<Suggestion> score(Stream<ActionDefinition> actions, ColumnMetadata column)
focal_class.identifier: score
focal_class.modifiers: @Override public
focal_class.parameters: (Stream<ActionDefinition> actions, ColumnMetadata column)
focal_class.return: Stream<Suggestion>
focal_class.signature: Stream<Suggestion> score(Stream<ActionDefinition> actions, ColumnMetadata column)
focal_class.class_method_signature: SimpleSuggestionEngine.score(ActionDefinition actionDef, ColumnMetadata column)
focal_class.full_signature: @Override public Suggestion score(ActionDefinition actionDef, ColumnMetadata column)
focal_class.identifier: score
focal_class.modifiers: @Override public
focal_class.parameters: (ActionDefinition actionDef, ColumnMetadata column)
focal_class.return: Suggestion
focal_class.signature: Suggestion score(ActionDefinition actionDef, ColumnMetadata column)
focal_class.class_method_signature: SimpleSuggestionEngine.suggest(DataSet dataSet)
focal_class.full_signature: @Override public List<ActionDefinition> suggest(DataSet dataSet)
focal_class.identifier: suggest
focal_class.modifiers: @Override public
focal_class.parameters: (DataSet dataSet)
focal_class.return: List<ActionDefinition>
focal_class.signature: List<ActionDefinition> suggest(DataSet dataSet)
focal_method.body: @Override
      public Stream<Suggestion> score(Stream<ActionDefinition> actions, ColumnMetadata column) {
          return actions.map(actionMetadata -> score(actionMetadata, column)).sorted(SUGGESTION_COMPARATOR);
      }
focal_method.class_method_signature: SimpleSuggestionEngine.score(Stream<ActionDefinition> actions, ColumnMetadata column)
focal_method.full_signature: @Override public Stream<Suggestion> score(Stream<ActionDefinition> actions, ColumnMetadata column)
focal_method.identifier: score
focal_method.invocations: sorted map score
focal_method.modifiers: @Override public
focal_method.parameters: (Stream<ActionDefinition> actions, ColumnMetadata column)
focal_method.return: Stream<Suggestion>
focal_method.signature: Stream<Suggestion> score(Stream<ActionDefinition> actions, ColumnMetadata column)