Naming Vegetable Factories Given the code below, I'm curious to know if you'd have better naming suggestions for types:


VegetablePresentersFactory
VegetablePresenterFactory


It bothers me a bit that their names only differ by a single character ('s'), and that this character is located in the middle of the name. 

class VegetablesApp {
    private final VegetablePresentersFactory vegetablePresentersFactory; // gets injected

    public void displayVegetablePresenters(AllVegetables all) {
        List&lt;VegetablePresenter&gt; presenters = vegatablePresentersFactory.create(all);

        displayPresenters(presenters);
    }
}

class VegetablePresentersFactory {
    private final VegetablePresenterFactory vegetablePresenterFactory;

    public List&lt;VegetablePresenter&gt; create(AllVegetables all) {
        List&lt;VegetablePresenter&gt; presenters = new ArrayList&lt;&gt;();

        list.add(vegetablePresenterFactory.create(all.getTomato()));
        list.add(vegetablePresenterFactory.create(all.getLettuce()));
        list.add(vegetablePresenterFactory.create(all.getBacon()));

        return presenters;
    }
}

interface VegetablePresenterFactory {
    VegetablePresenter create(Vegetable vegetable);
}
How about replacing "s" of plural with the word "List":

interface VegetablePresenterListFactory {    
    List&lt;VegetablePresenter&gt; create(AllVegetables allVegetables);
}


Like you said, the s in the middle is indeed a problem.
The difference is too small: it can lead to errors, and it hurts readability.

The same is true for name vs names in this code snippet:


void printNames(List&lt;String&gt; names) {
    for (String name : names) {
        // ...
    }
}



Although errors may sound unlikely because name and names are completely different types,
it can still happen when there are methods with the same name that happen to work on both objects,
for example isEmpty.

In such cases I use the suffix List to disambiguate, so nameList.
It's true that the term "List" is a bit redundant.
But it's better to be redundant than ambiguous,
so the little redundancy is justified by the improved readability.

UPDATE

You mentioned in the comment that "List" is a bit unfortunate if in the future you change the interface to use a Set instead of a List.
I think that's a moot point.
Changing the interface is a big deal,
and must be done carefully.
If you change the method to return a Set instead of a List,
I think you should be careful enough to notice that the interface name should change as well.
In terms of migrating users of the API,
this should not be a significant additional burden.

That said, I do have an alternative offering, using the word "Items" instead of "List":

interface VegetablePresenterItemsFactory {    
    List&lt;VegetablePresenter&gt; create(AllVegetables allVegetables);
}


The good thing about "Items" is that it's less technical.
It's vague enough to be flexible, but not too vague to be meaningless.
Perhaps there are even better synonyms, you get the idea.