Here you can find the source of in(String needle, String... haystack)
public static boolean in(String needle, String... haystack)
//package com.java2s; public class Main { public static boolean in(String needle, String... haystack) { for (String hay : haystack) { if (hay.equals(needle)) return true; }//from w w w. j a v a2s .c om return false; } }