import com.google.gwt.query.client.js.JsUtils;
import java.util.Arrays;
+import java.util.Collection;
import java.util.List;
/**
public <T extends IsProperties> T set(Object key, Object val) {
if (val instanceof IsProperties) {
p.set(key, ((IsProperties) val).getDataImpl());
+ } else if (val instanceof Object[]) {
+ setArrayBase(String.valueOf(key), (Object[]) val);
+ } else if (val instanceof Collection) {
+ Collection collection = (Collection) val;
+ setArrayBase(String.valueOf(key), collection.toArray(new Object[collection.size()]));
} else {
p.set(key, val);
}
user.set("name", "Random Name");
user.set("phones", Collections.emptyList());
String json = user.toJson();
-
+
//WHEN fetching that user
GUser retrievedUser = GQ.create(GUser.class);
retrievedUser.parse(json, true);
-
+
//THEN
assertEquals(0, retrievedUser.getPhones().size());
}