EventGroupRemoteDescriptor (@NotNull String groupId, @NotNull Set<String> eventData) { final EventGroupRemoteDescriptor group = new EventGroupRemoteDescriptor(); group.id = groupId; if (group.versions != null) { group.versions.add(new EventGroupRemoteDescriptors.GroupVersionRange("1", null)); } GroupRemoteRule rule = new GroupRemoteRule(); rule.event_id = new HashSet<>(Collections.singletonList(TEST_RULE)); final Map<String, Set<String>> dataRules = new HashMap<>(); for (String datum : eventData) { dataRules.put(datum, new HashSet<>(Collections.singletonList(TEST_RULE))); } rule.event_data = dataRules; group.rules = rule; return group; }