package uk.ac.ebi.atlas.species;

import org.apache.commons.lang.StringUtils;

import javax.inject.Inject;
import javax.inject.Named;

@Named
public class SpeciesFactory {

    private final SpeciesPropertiesTrader speciesPropertiesTrader;

    @Inject
    public SpeciesFactory(SpeciesPropertiesTrader speciesPropertiesTrader) {
        this.speciesPropertiesTrader = speciesPropertiesTrader;
    }

    public Species create(String name) {
        return StringUtils.isNotEmpty(name) ? new Species(name, speciesPropertiesTrader.get(name)) : new Species("", SpeciesProperties.UNKNOWN);
    }
}

@@ -31,53 +31,8 @@
 s;%0A%0A
-import org.apache.commons.lang.StringUtils;%0A%0A
 impo
@@ -408,39 +408,8 @@
 turn
- StringUtils.isNotEmpty(name) ?
  new
@@ -461,10 +461,75 @@
 me))
- :
+;%0A    %7D%0A%0A    public Species createUnknownSpecies() %7B%0A        return
  new

Add explicit method to create an unknown species to express a clearer intent (sometimes a species will be unknown if we can’t map it to a reference species, sometimes we actually want an unknown species, no matter what it is)