intersect

infix fun ByteBuffer.intersect(other: Iterable<Byte>): Set<Byte>
infix fun ShortBuffer.intersect(other: Iterable<Short>): Set<Short>
infix fun IntBuffer.intersect(other: Iterable<Int>): Set<Int>
infix fun LongBuffer.intersect(other: Iterable<Long>): Set<Long>
infix fun FloatBuffer.intersect(other: Iterable<Float>): Set<Float>
infix fun DoubleBuffer.intersect(other: Iterable<Double>): Set<Double>
infix fun CharBuffer.intersect(other: Iterable<Char>): Set<Char>

Returns a set containing all elements that are contained by both this array and the specified collection.

The returned set preserves the element iteration order of the original array.

To get a set containing all elements that are contained at least in one of these collections use union.