public boolean isAValidKey(Integer key) throws Exception {
    for (Integer code : getKeySet()) {
      if (key.equals(code))
        return true;
    }

    throw new KeyException("Key is Invalid");
  }