How can i do instance of inside Java 8 stream
for (List<Category> parentPath : getPathsInternal(parent, controlSet)) {
if (!(parentPath instanceof LinkedList)) {
parentPath = new LinkedList<Category>(parentPath);
}
parentPath.add(category);
result.add(parentPath);
}
I am not sure how to write such function in Java 8 stream . Any directions ?
if (!(parentPath instanceof LinkedList)) {
parentPath = new LinkedList<Category>(parentPath);
}