/** * Multiple threads searching for an element in an * array may cause a data race but not a race condition. */ public class Search { private int[] collection; private boolean found; public Search(int[] collection) { super(); this.collection = collection; this.found = false; } public void find(int from, int to, int element) { for (int i = from; i < to && !this.found; i++) { if (this.collection[i] == element) { this.found = true; } } } }