public static <T> Object defaultPrimitive(Class<T> type) {
    if (type.equals(byte.class)) {
      return (byte) Math.random();
    } else if (type.equals(int.class)) {
      return (int) Math.random();
    } else if (type.equals(double.class)) {
      return Math.random();
    } else if (type.equals(char.class)) {
      return (char) Math.random();
    } else if (type.equals(boolean.class)) {
      return Math.random() > 0.5 ? true : false;
    } else if (type.equals(long.class)) {
      return (long) Math.random();
    } else if (type.equals(float.class)) {
      return (float) Math.random();
    } else if (type.equals(short.class)) {
      return (short) Math.random();
    }

    throw new RuntimeException("Not a primitive type: " + type.getCanonicalName());
  }