### Question:
JMXMetricHolder { public List<Object> findAll(List<String> properties) { return properties.stream() .map(this::find) .filter(Optional::isPresent) .map(Optional::get) .collect(toList()); }  List<Map<String, Object>> getBeans(); void setBeans(List<Map<String, Object>> beans); @Override String toString(); List<Object> findAll(List<String> properties); Optional<Object> find(String pattern);  }### Answer:
@Test public void testFindMultipleBeansByName() throws Exception { List<Object> result = metrics.findAll(asList("bean1/value", "bean2/value", "bean3/notfound")); assertThat(result, hasItems("val1", "val2")); }
@Test public void testFindNestedBean() throws Exception { List<Object> result = metrics.findAll(asList("nested/value[key1]", "nested/value[key2]")); assertThat(result, hasItems("nested-val1", "nested-val2")); }