private static boolean doesPatternExist(Map<Byte, byte[]> haystack,
                                            byte[] needle) {
        if (needle == null)
            return false;
        for (Byte key : haystack.keySet()) {
            if (Arrays.equals(haystack.get(key), needle)) {
                return true;
            }
        }
        return false;
    }