code: private static Object defaultForType(Class<?> type)
      {
          if (!type.isPrimitive()) {
              return null;
          }
          if (type.equals(boolean.class)) {
              return false;
          }
          if (type.equals(long.class)) {
              return (long) 0L;
          }
          if (type.equals(int.class)) {
              return (int) 0;
          }
          if (type.equals(short.class)) {
              return (short) 0;
          }
          if (type.equals(byte.class)) {
              return (byte) 0;
          }
          if (type.equals(char.class)) {
              return (char) '\u0000';
          }
          if (type.equals(float.class)) {
              return (float) 0.0f;
          }
          if (type.equals(double.class)) {
              return (double) 0.0d;
          }
          // should never happen
          throw new IllegalStateException("Unknown primitive type: " + type.getName());
      }
docs: Provide the default value for any given type.
  
  @param type Type to get the default for
  @return default value - primitive value or null depending on the type.