UserFunctionExecution implements InternalFunction<Object[]> { Set<String> parseFilters(String filterString) { if (filterString != null && filterString.length() > 0) { return Arrays.stream(filterString.split(",")).collect(Collectors.toSet()); } else { return new HashSet<>(); } }  @Override boolean isHA(); @Override String getId(); @Override Collection<ResourcePermission> getRequiredPermissions(String regionName); @Override void execute(FunctionContext<Object[]> context); static final String ID; }
@Test public void parseFiltersTest() { assertThat(function.parseFilters(null)).isNotNull().isEmpty(); assertThat(function.parseFilters("")).isNotNull().isEmpty(); assertThat(function.parseFilters("key1,key2")).isNotNull().containsOnly("key1", "key2"); }