Skip to content

2-2-7 containsValue method accepts wrong solution #161

Open
@obaibula

Description

@obaibula

The containsValues()'s tests accept this wrong solution.

This solution doesn't work if in the bucket's element are more than one Node.

@Override public boolean containsValue(V value) { return Arrays.stream(table) .filter(Objects::nonNull) .map(node -> node.value) .anyMatch(v -> v.equals(value)); }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions