@SuppressWarnings("unchecked")
  boolean getBooleanValue(Object obj, int k) {
    if ((obj instanceof ArgHolder<?>)
        && ((ArgHolder<?>) obj).getType().equals(Boolean.class)) {
      return ((ArgHolder<Boolean>) obj).getValue();
    } else if (obj instanceof boolean[]) {
      return ((boolean[]) obj)[k];
    } else {
      verify(false, "object doesn't contain boolean values");
      return false;
    }
  }