### Question:
FeatureRegistry { public List<String> getFeatures(Collection<String> needed) { List<FeatureNode> fullTree = getTransitiveDeps(needed, Lists.<String>newLinkedList()); List<String> allFeatures = Lists.newLinkedList(); for (FeatureNode node : fullTree) { allFeatures.add(node.name); } return allFeatures; } @Inject  FeatureRegistry(FeatureResourceLoader resourceLoader,
                         CacheProvider cacheProvider,
                         @Named("org.apache.shindig.features") List<String> features,
                         FeatureFileSystem fileSystem);  FeatureRegistry(FeatureResourceLoader resourceLoader,
      CacheProvider cacheProvider,
      @Named("org.apache.shindig.features") List<String> features,
      FeatureFileSystem fileSystem, String repository); String getRepository(); LookupResult getFeatureResources(
      GadgetContext ctx, Collection<String> needed, List<String> unsupported, boolean transitive); LookupResult getFeatureResources(GadgetContext ctx, Collection<String> needed,
      List<String> unsupported); LookupResult getAllFeatures(); List<String> getFeatures(Collection<String> needed); Set<String> getAllFeatureNames(); static final String CACHE_NAME; static final String RESOURCE_SCHEME; static final String FILE_SCHEME; static final Splitter CRLF_SPLITTER; }### Answer:
@Test public void getFeaturesStringsNoTransitive() throws Exception { setupFullRegistry("gadget", null); List<String> needed = Lists.newArrayList("nodep", "bottom"); List<String> featureNames = registry.getFeatures(needed); assertEquals(2, featureNames.size()); assertEquals("nodep", featureNames.get(0)); assertEquals("bottom", featureNames.get(1)); }
@Test public void getFeaturesStringsTransitive() throws Exception { setupFullRegistry("gadget", null); List<String> needed = Lists.newArrayList("top", "nodep"); List<String> featureNames = registry.getFeatures(needed); assertEquals(5, featureNames.size()); assertEquals("bottom", featureNames.get(0)); assertEquals("mid_a", featureNames.get(1)); assertEquals("mid_b", featureNames.get(2)); assertEquals("top", featureNames.get(3)); assertEquals("nodep", featureNames.get(4)); }