Add null-like value to String in Java
Clash Royale CLAN TAG #URR8PPP Add null-like value to String in Java I am writing test method like setTask(Task task) . And Task object has several fields, e.g. setTask(Task task) Task public String vehicle; Method setTask should be used in different test-cases, so I'd like to have an options for this field to accept values: setTask null some string value "", "Hello, World!", "Iso Isetta", ... random So what can I do to make String to be SpecialString which could accept values null , random & some string value ? (BTW: I don't want to set it to string value "RANDOM", and chech whether the value is equal to "RANDOM"-string) String SpecialString null random some string value UPDATE: I don't mean random like random value from a set of values , I mean random as well as null and this is for setTask() to handle random (select random from drop-down), and not to pass a random string from a set of values. random random ...