code: public boolean isAllowed(final DeviceState state) {
          boolean isAllowed = true;
          if (deniedStates.contains(state)) {
              isAllowed = false;
          }
          return isAllowed;
      }
docs: Check if a state is allowed
  
  @param state
  @return true if allowed