CommaSeparatedStringEditor implements PropertyEditor<HasEnumConstantsProperty> { @Override public Stream<Item> fieldsFor(HasEnumConstantsProperty column) { final DOC document; try { @SuppressWarnings("unchecked") final DOC doc = (DOC) column; document = doc; } catch (final ClassCastException ex) { throw new SpeedmentException("Expected document to be a valid column, but was a '" + column.getClass().getName() + "'."); } return Stream.of( new AddRemoveStringItem<>( document, "Enum Constants", document.enumConstantsProperty(), "Used for defining what constants the generated enum can have", Bindings.equal(document.typeMapperProperty(), StringToEnumTypeMapper.class.getName()) ) ).map(injector::inject); }  @Override Stream<Item> fieldsFor(HasEnumConstantsProperty column); @Inject public Injector injector; }
@Test void fieldsFor() throws InstantiationException { final Injector injector = Injector.builder().build(); final CommaSeparatedStringEditor<ColumnProperty> editor = new CommaSeparatedStringEditor<>(); injector.inject(editor); assertThrows(Exception.class, () -> editor.fieldsFor(hasEnumConstantsProperty)); }