ImmutableThingPlaceholder extends AbstractEntityPlaceholder<ThingId> implements ThingPlaceholder { @Override public Optional<String> resolve(final CharSequence thingId, final String placeholder) { argumentNotEmpty(placeholder, "placeholder"); checkNotNull(thingId, "Thing ID"); if (thingId instanceof ThingId) { return doResolve(((ThingId) thingId), placeholder); } else { return Optional.empty(); } }  @Override String getPrefix(); @Override Optional<String> resolve(final CharSequence thingId, final String placeholder);  }
@Test public void testReplaceThingId() { assertThat(UNDER_TEST.resolve(THING_ID, "id")).contains(THING_ID.toString()); }
@Test public void testReplaceThingName() { assertThat(UNDER_TEST.resolve(THING_ID, "name")).contains(NAME); }
@Test public void testReplaceThingNamespace() { assertThat(UNDER_TEST.resolve(THING_ID, "namespace")).contains(NAMESPACE); }
@Test public void testUnknownPlaceholderReturnsEmpty() { assertThat(UNDER_TEST.resolve(THING_ID, "thing_id")).isEmpty(); }