ItemDTOMapper { public static GroupFunction mapFunction(@Nullable Item baseItem, GroupFunctionDTO function) { return GROUP_FUNCTION_HELPER.createGroupFunction(function, baseItem); }  static @Nullable Item map(ItemDTO itemDTO, ItemBuilderFactory itemBuilderFactory); static GroupFunction mapFunction(@Nullable Item baseItem, GroupFunctionDTO function); static ItemDTO map(Item item); static @Nullable GroupFunctionDTO mapFunction(@Nullable GroupFunction function);  }
@Test public void testMapFunctionWithNumberItemAndCountFunction() { NumberItem item1 = new NumberItem("item1"); GroupFunctionDTO gFuncDTO = new GroupFunctionDTO(); gFuncDTO.name = "COUNT"; gFuncDTO.params = new String[] { ".*hello.*" }; GroupFunction gFunc = ItemDTOMapper.mapFunction(item1, gFuncDTO); assertThat(gFunc, instanceOf(ArithmeticGroupFunction.Count.class)); assertThat(gFunc.getParameters().length, is(1)); assertThat(gFunc.getParameters()[0], instanceOf(StringType.class)); }