LookupIdentifier { public LookupIdentifier getNestedLookupIdentifier(final String newKey) { if (!isMapNested()) { throw new RuntimeException(LogUtil.message("Identifier {} is not nested", this)); } return new LookupIdentifier(secondaryMapName, newKey, eventTime); } LookupIdentifier(final String map, final String key, final long eventTime); static LookupIdentifier of(final String map, final String key, final long eventTime); static LookupIdentifier of(final String map, final String key, final String eventTimeStr); void append(final StringBuilder sb); boolean isMapNested(); String getMap(); String getKey(); long getEventTime(); String getPrimaryMapName(); String getSecondaryMapName(); LookupIdentifier getNestedLookupIdentifier(final String newKey); LookupIdentifier cloneWithNewKey(String newKey); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode();  }
@Test void getNestedLookupIdentifier() { String map = "map1" + LookupIdentifier.NEST_SEPARATOR + "map2" + LookupIdentifier.NEST_SEPARATOR + "map3"; LookupIdentifier identifier = new LookupIdentifier(map, "key1", 12345); LookupIdentifier nestedIdentifier = identifier.getNestedLookupIdentifier("key2"); assertThat(nestedIdentifier.isMapNested()).isTrue(); assertThat(nestedIdentifier.getPrimaryMapName()).isEqualTo("map2"); assertThat(nestedIdentifier.getMap()).isEqualTo("map2" + LookupIdentifier.NEST_SEPARATOR + "map3"); assertThat(nestedIdentifier.getKey()).isEqualTo("key2"); LookupIdentifier secondNestedIdentifier = nestedIdentifier.getNestedLookupIdentifier("key3"); assertThat(secondNestedIdentifier.isMapNested()).isFalse(); assertThat(secondNestedIdentifier.getMap()).isEqualTo("map3"); }