Here you can find the source of contains(int bit, int... options)
public static boolean contains(int bit, int... options)
//package com.java2s; public class Main { public static boolean contains(int bit, int... options) { return (bit & and(options)) == and(options); }//w w w .j av a2 s . c om public static int and(int... options) { int out = options[0]; for (int index = 1; index < options.length; index++) { out &= options[index]; } return out; } }