assertEquals(5, ArrayOperations.findClosestIndex(array, "dessert", dfd));
assertEquals(3, ArrayOperations.findClosestIndex(array, "int", dfd));
assertEquals(0, ArrayOperations.findClosestIndex(array, "strong", dfd));
assertEquals(4, ArrayOperations.findClosestIndex(array, "attire", dfd));
assertEquals(1, ArrayOperations.findClosestIndex(array, "sassy", dfd));
DistanceFunction edf = new StringEditDistanceFunction(StringEditDistanceFunction.Mode.DEFAULT);
assertEquals(2, ArrayOperations.findClosestIndex(array, "nes", edf));
assertEquals(1, ArrayOperations.findClosestIndex(array, "artsy", edf));
assertEquals(2, ArrayOperations.findClosestIndex(array, "newly", edf));
assertEquals(4, ArrayOperations.findClosestIndex(array, "dessert", edf));
assertEquals(3, ArrayOperations.findClosestIndex(array, "int", edf));
assertEquals(0, ArrayOperations.findClosestIndex(array, "strong", edf));
assertEquals(0, ArrayOperations.findClosestIndex(array, "attire", edf));
assertEquals(5, ArrayOperations.findClosestIndex(array, "because", edf));
assertEquals(1, ArrayOperations.findClosestIndex(array, "sassy", edf));
DistanceFunction edfa = new StringEditDistanceFunction(StringEditDistanceFunction.Mode.ALPHABETIC_REPLACE);
assertEquals(2, ArrayOperations.findClosestIndex(array, "nes", edfa));
assertEquals(1, ArrayOperations.findClosestIndex(array, "artsy", edfa));
assertEquals(2, ArrayOperations.findClosestIndex(array, "newly", edfa));
assertEquals(4, ArrayOperations.findClosestIndex(array, "dessert", edfa));
assertEquals(3, ArrayOperations.findClosestIndex(array, "int", edfa));
assertEquals(0, ArrayOperations.findClosestIndex(array, "strong", edfa));
assertEquals(4, ArrayOperations.findClosestIndex(array, "attire", edfa));
assertEquals(4, ArrayOperations.findClosestIndex(array, "because", edfa));
assertEquals(1, ArrayOperations.findClosestIndex(array, "sassy", edfa));
DistanceFunction edfk = new StringEditDistanceFunction(StringEditDistanceFunction.Mode.KEYBOARD_REPLACE);
assertEquals(2, ArrayOperations.findClosestIndex(array, "nes", edfk));
assertEquals(1, ArrayOperations.findClosestIndex(array, "artsy", edfk));
assertEquals(2, ArrayOperations.findClosestIndex(array, "newly", edfk));
assertEquals(4, ArrayOperations.findClosestIndex(array, "dessert", edfk));
assertEquals(3, ArrayOperations.findClosestIndex(array, "int", edfk));