@Nullable
  public static Object getDefaultValue(Class<?> type) {
    if (!type.isPrimitive()) return null;

    else if (type == boolean.class) return false;
    else if (type == int.class) return 0;
    else if (type == long.class) return 0L;
    else if (type == float.class) return 0F;
    else if (type == double.class) return 0D;
    else if (type == char.class) return (char) 0;
    else if (type == short.class) return (short) 0;
    else if (type == byte.class) return (byte) 0;

    assert type == void.class;
    return null;
  }
Returns the class file for the given class (which has been verified to exist in the returned location),
or null if the class file could not be found (e.g. because it is contained in a Jar).
spock-core/src/main/java/org/spockframework/util/ReflectionUtil.java