void addGetModelsMethod(StringBuilder sb) {
        sb.append(
                "    @Override\n" +
                        "    public java.util.List<Model> getModels() {\n" +
                        "        return java.util.Arrays.asList(" );
        String collected =  modelsByKBase.values().stream().flatMap( List::stream ).distinct()
                .map(element -> "new " + element + "()")
                .collect(Collectors.joining(","));
        sb.append(collected);
        sb.append(
                ");\n" +
                        "    }\n" +
                        "\n");
    }
@Test
    public void addGetModelsMethodEmptyModelsByKBaseValuesTest() {
        Map<String, List<String>> modelsByKBase = new HashMap<>();
        modelsByKBase.put("default-kie", Collections.emptyList());
        ModelSourceClass modelSourceClass = new ModelSourceClass(RELEASE_ID, new HashMap<>(), modelsByKBase);
        StringBuilder sb = new StringBuilder();
        modelSourceClass.addGetModelsMethod(sb);
        String retrieved = sb.toString();
        String expected = "return java.util.Arrays.asList();";
        assertThat(retrieved.contains(expected)).isTrue();
        String unexpected = "return java.util.Arrays.asList(new ());";
        assertThat(retrieved.contains(unexpected)).isFalse();
    }