boolean (Integer head, Integer exit) { Map<Integer, Integer> filter = mapExceptionRangeUniqueExit.get(head); for (Entry<Integer, Integer> entry : filter.entrySet()) { if (!head.equals(mapExceptionDoms.get(entry.getKey()))) { Integer filterExit = entry.getValue(); if (filterExit == -1 || !filterExit.equals(exit)) { return false; } } } return true; }