sync java code with NSDictionary behaviour on ios