@@ -26,37 +26,37 @@ public static void main(String[] args) {
26
26
27
27
System .out .println ("\n Simple solution for numbers:" );
28
28
long startTimeV1 = clock .millis ();
29
- boolean found1 = ArrayFinds .findElementV1 (numbers .clone (), 1 );
29
+ boolean found1 = ArrayFinds .containsElementV1 (numbers .clone (), 1 );
30
30
displayExecutionTime (clock .millis () - startTimeV1 );
31
31
System .out .println ("The element was found?: " + found1 );
32
32
33
33
System .out .println ("\n Solution based on Arrays.binarySearch() for numbers:" );
34
34
long startTimeV2 = clock .millis ();
35
- boolean found2 = ArrayFinds .findElementV2 (numbers .clone (), 1 );
35
+ boolean found2 = ArrayFinds .containsElementV2 (numbers .clone (), 1 );
36
36
displayExecutionTime (clock .millis () - startTimeV2 );
37
37
System .out .println ("The element was found?: " + found2 );
38
38
39
39
System .out .println ("\n Solution based on Stream.anyMatch() for numbers:" );
40
40
long startTimeV3 = clock .millis ();
41
- boolean found3 = ArrayFinds .findElementV3 (numbers .clone (), 1 );
41
+ boolean found3 = ArrayFinds .containsElementV3 (numbers .clone (), 1 );
42
42
displayExecutionTime (clock .millis () - startTimeV3 );
43
43
System .out .println ("The element was found?: " + found3 );
44
44
45
45
System .out .println ("\n Simple solution for Melon:" );
46
46
long startTimeV4 = clock .millis ();
47
- boolean found4 = ArrayFinds .findElementObjectV1 (melons .clone (), new Melon ("Gac" , 1200 ));
47
+ boolean found4 = ArrayFinds .containsElementObjectV1 (melons .clone (), new Melon ("Gac" , 1200 ));
48
48
displayExecutionTime (clock .millis () - startTimeV4 );
49
49
System .out .println ("The Melon was found?: " + found4 );
50
50
51
51
System .out .println ("\n Solution based on Comparator for Melon:" );
52
52
long startTimeV5 = clock .millis ();
53
- boolean found5 = ArrayFinds .findElementObjectV2 (melons .clone (), new Melon ("Gac" , 1205 ), byType );
53
+ boolean found5 = ArrayFinds .containsElementObjectV2 (melons .clone (), new Melon ("Gac" , 1205 ), byType );
54
54
displayExecutionTime (clock .millis () - startTimeV5 );
55
55
System .out .println ("The Melon was found?: " + found5 );
56
56
57
57
System .out .println ("\n Solution based on binarySearch() for Melon:" );
58
58
long startTimeV6 = clock .millis ();
59
- boolean found6 = ArrayFinds .findElementObjectV3 (melons .clone (), new Melon ("Honeydew" , 1200 ), byWeight );
59
+ boolean found6 = ArrayFinds .containsElementObjectV3 (melons .clone (), new Melon ("Honeydew" , 1200 ), byWeight );
60
60
displayExecutionTime (clock .millis () - startTimeV6 );
61
61
System .out .println ("The Melon was found?: " + found6 );
62
62
0 commit comments