final HashSet<String> VALUES = new HashSet<String>(Arrays.asList(new String[] {"OK (0.07, 0.05, 0.01)", "OK (0.07, 0.05, 0.02)", "OK (0.07, 0.05, 0.03)", "OK (0.07, 0.05, 0.04)"})); String s="OK"; System.out.println(VALUES.contains(s)); Gives me false. How do I check if "OK" exists in each of the elements?
new String[] {or the closing}. JustArrays.asList("OK (0.07, 0.05, 0.01)", ... ).asListtakes a varargsString....