InjectionExample { public Map<String, String> convertBooks(List<Book> books) { return bookListConverter.apply(books); } @Autowired  InjectionExample(Function<List<Book>, Map<String, String>> bookListConverter,
                            Supplier<List<Book>> bookListSupplier,
                            @Qualifier("lowRainfall") Predicate<City> lowRainfallPredicate,
                            @Qualifier("smallPopulation") Predicate<City> smallPopulationPredicate); Map<String, String> convertBooks(List<Book> books); List<Book> getListOfBooks(); List<City> filterByPopulation(List<City> cities); List<City> filterByRainfall(List<City> cities);  }
@Test public void testConvertBooks() throws Exception { Book b = new Book.Builder().isbn("1234567").title("book1").publisher("acme").price(59.99).build(); Book b2 = new Book.Builder().isbn("23456878").title("book2").publisher("acme").price(39.99).build(); List<Book> books = Lists.newArrayList(b, b2); Map<String, String> bookMap = example.convertBooks(books); String expectedValue = "book1|acme|59.99"; assertThat(bookMap.get("1234567"), is(expectedValue)); }