public Mappings getMapping(String tableName) {
        Map<String, Object> properties =
            mappingStructures.containsKey(tableName) ?
                mappingStructures.get(tableName).properties : new HashMap<>();
        Mappings.Source source =
                    mappingStructures.containsKey(tableName) ?
                        mappingStructures.get(tableName).source : new Mappings.Source();
        return Mappings.builder()
                       .type(ElasticSearchClient.TYPE)
                       .properties(properties)
                       .source(source)
                       .build();
    }
@Test
    public void getMapping() {
        IndexStructures structures = new IndexStructures();
        HashMap<String, Object> properties = new HashMap<>();
        properties.put("a", "b");
        properties.put("c", "d");
        structures.putStructure(
            "test", Mappings.builder()
                            .type(ElasticSearchClient.TYPE)
                            .properties(properties)
                            .build(), new HashMap<>());
        Mappings mapping = structures.getMapping("test");
        Assertions.assertEquals(mapping.getProperties(), properties);

        structures.putStructure(
            "test2", Mappings.builder()
                             .type(ElasticSearchClient.TYPE)
                             .properties(new HashMap<>())
                             .build(), new HashMap<>());
        mapping = structures.getMapping("test2");

        Assertions.assertTrue(mapping.getProperties().isEmpty());
        //test with source
        IndexStructures structuresSource = new IndexStructures();
        Mappings.Source source = new Mappings.Source();
        source.getExcludes().add("a");
        structuresSource.putStructure(
            "test", Mappings.builder()
                            .type(ElasticSearchClient.TYPE)
                            .properties(properties)
                            .source(source)
                            .build(), new HashMap<>());
        Assertions.assertEquals(properties, structuresSource.getMapping("test").getProperties());
        Assertions.assertEquals(source.getExcludes(), structuresSource.getMapping("test").getSource().getExcludes());
    }