final Collection<Object> someData = ImmutableList.of("string", (Object) 99, 4343434.345345d);
// Other types are supported (anything valid for org.json.JSONObject), but equality comparisons
// are more complicated because JSON doesn't implement interfaces like Collection or Map, or
// implementing equals.
PreloadedData preloadedData = new PreloadedData() {
public Collection<Object> toJson() throws PreloadException {
return someData;
}
};
Gadget gadget = makeDefaultGadget().setPreloads(ImmutableList.of(preloadedData));