### Question:
MapReferMetadataCreator implements ReferMetadataCreator { @Override public ReferMetadata getReferMetadata(Type type, String path) { Type refType = getMapValueGeneric(type); String ref = String.format("get(\"%s\")", path.replace("[*]", "")); return new ReferMetadata(refType, ref, path); }  @Override boolean isApplicable(Type type, String ref); @Override ReferMetadata getReferMetadata(Type type, String path);  }### Answer:
@Test void shouldCreateMetadataWhenNoGroupingOperator() { MapReferMetadataCreator mapBased = new MapReferMetadataCreator(); ReferMetadata referMetadata = mapBased.getReferMetadata(TestMapClass.class, "key"); ReferMetadata expected = new ReferMetadata(String.class, "get(\"key\")", "key"); assertThat(referMetadata).isEqualTo(expected); }
@Test void shouldCreateMetadataWhenGroupingOperator() { MapReferMetadataCreator mapBased = new MapReferMetadataCreator(); ReferMetadata referMetadata = mapBased.getReferMetadata(TestMapClass.class, "key[*]"); ReferMetadata expected = new ReferMetadata(String.class, "get(\"key\")", "key[*]"); assertThat(referMetadata).isEqualTo(expected); }