I have a Map<String,ExtractedData> extractedDatas and I want to extract some data as return result. I'm quite new with the Stream API and I don't understand what I have to do. I tried with
public Map<String,ExtractedData> getExtractedData(String name)
{
return extractedDatas.entrySet().stream()
.filter(entry -> entry.getKey().startsWith(name))
.filter(entry -> entry.getValue().getFieldValue() != null && entry.getValue().getFieldValue() != "")
.collect(Collectors.toMap(...);
}
What do I have to put in the Collectors.toMap ?