ExperimentalFeatureEditor implements ExperimentalFeatureEditorView.Presenter,
                                                  IsElement,
                                                  Comparable<ExperimentalFeatureEditor> { @Override public int compareTo(ExperimentalFeatureEditor other) { return comparator.compare(this.getName(), other.getName()); } @Inject  ExperimentalFeatureEditor(ExperimentalFeatureDefRegistry registry, TranslationService translationService, ExperimentalFeatureEditorView view); @PostConstruct void init(); void render(EditableExperimentalFeature feature, ParameterizedCommand<EditableExperimentalFeature> onChange); String getName(); EditableExperimentalFeature getFeature(); @Override void notifyChange(boolean newEnabledValue); @Override HTMLElement getElement(); @Override int compareTo(ExperimentalFeatureEditor other); boolean isEnabled(); void enable();  }
@Test public void testCompareTo() { new ArrayList<>(); ExperimentalFeatureEditor editor4 = new ExperimentalFeatureEditor(defRegistry, translationService, mock(ExperimentalFeatureEditorView.class)); ExperimentalFeatureImpl feature3 = new ExperimentalFeatureImpl(TestExperimentalFeatureDefRegistry.FEATURE_3, false); ExperimentalFeatureEditor editor3 = new ExperimentalFeatureEditor(defRegistry, translationService, mock(ExperimentalFeatureEditorView.class)); editor3.render(new EditableExperimentalFeature(feature3), mock(ParameterizedCommand.class)); ExperimentalFeatureImpl feature1 = new ExperimentalFeatureImpl(TestExperimentalFeatureDefRegistry.FEATURE_1, false); ExperimentalFeatureEditor editor1 = new ExperimentalFeatureEditor(defRegistry, translationService, mock(ExperimentalFeatureEditorView.class)); editor1.render(new EditableExperimentalFeature(feature1), mock(ParameterizedCommand.class)); ExperimentalFeatureEditor editor5 = new ExperimentalFeatureEditor(defRegistry, translationService, mock(ExperimentalFeatureEditorView.class)); ExperimentalFeatureImpl feature2 = new ExperimentalFeatureImpl(TestExperimentalFeatureDefRegistry.FEATURE_2, false); ExperimentalFeatureEditor editor2 = new ExperimentalFeatureEditor(defRegistry, translationService, mock(ExperimentalFeatureEditorView.class)); editor2.render(new EditableExperimentalFeature(feature2), mock(ParameterizedCommand.class)); List<ExperimentalFeatureEditor> editors = Arrays.asList(editor1, editor2, editor3, editor4, editor5); List<ExperimentalFeatureEditor> sortedEditors = editors.stream().sorted().collect(Collectors.toList()); Assertions.assertThat(sortedEditors) .hasSize(editors.size()) .containsExactly(editor4, editor5, editor1, editor2, editor3); }