### Question:
ComputedPropertiesImpl implements ComputedProperties { public List<ComputedProperty> getComputedProperties() { if (log.isDebugEnabled()) { log.debug("Returning this list of highest ranking Computed Prooerties by label"); rankedComputedProperties.stream().forEach(computedProperty -> { log.debug("Computed property: [ name: {} ] - [ label: {} ]", computedProperty.getName(), computedProperty.getLabel()); }); } return new ArrayList<>(rankedComputedProperties); }  List<ComputedProperty> getComputedProperties();  }### Answer:
@Test public void getComputedProperties() { final TitleImpl title1 = new TitleImpl(); final TitleImpl title2 = new TitleImpl(); final TitleImpl title3 = new TitleImpl(); final FileSizeImpl fileSize = new FileSizeImpl(); final ComputedProperties computedProperties = new ComputedPropertiesImpl(); ctx.registerInjectActivateService(computedProperties); ctx.registerInjectActivateService(title1, Constants.SERVICE_RANKING, "0"); ctx.registerInjectActivateService(title2, Constants.SERVICE_RANKING, "200"); ctx.registerInjectActivateService(title3, Constants.SERVICE_RANKING, "100"); ctx.registerInjectActivateService(fileSize, Constants.SERVICE_RANKING, "1000"); List<ComputedProperty> actual = computedProperties.getComputedProperties(); assertEquals(2, actual.size()); assertEquals(actual.get(0), fileSize); assertEquals(actual.get(1), title2); }
@Test public void getComputedProperties_Bind() { final TitleImpl title1 = new TitleImpl(); final TitleImpl title2 = new TitleImpl(); final TitleImpl title3 = new TitleImpl(); final TitleImpl title4 = new TitleImpl(); final ComputedProperties computedProperties = new ComputedPropertiesImpl(); ctx.registerInjectActivateService(computedProperties); ctx.registerInjectActivateService(title1, Constants.SERVICE_RANKING, "0"); ctx.registerInjectActivateService(title2, Constants.SERVICE_RANKING, "200"); List<ComputedProperty> actual = computedProperties.getComputedProperties(); assertEquals(1, actual.size()); assertEquals(actual.get(0), title2); ctx.registerInjectActivateService(title3, Constants.SERVICE_RANKING, "300"); actual = computedProperties.getComputedProperties(); assertEquals(1, actual.size()); assertEquals(actual.get(0), title3); ctx.registerInjectActivateService(title4, Constants.SERVICE_RANKING, "-1"); actual = computedProperties.getComputedProperties(); assertEquals(1, actual.size()); assertEquals(actual.get(0), title3); }