ImmutableFeatures implements Features { @Override public Features setProperties(final String featureId, final FeatureProperties properties) { checkNotNull(properties, "properties to be set"); Feature feature = getFeatureOrNull(featureId); if (null != feature) { feature = feature.setProperties(properties); } else { feature = ThingsModelFactory.newFeature(featureId, properties); } return setFeature(feature); } private  ImmutableFeatures(final Map<String, Feature> features); static ImmutableFeatures empty(); static ImmutableFeatures of(final Iterable<Feature> features); static ImmutableFeatures of(final Feature feature, final Feature... additionalFeatures); @Override Optional<Feature> getFeature(final String featureId); @Override Features setFeature(final Feature feature); @Override Features removeFeature(final String featureId); @Override Features setDefinition(final String featureId, final FeatureDefinition definition); @Override Features removeDefinition(final String featureId); @Override Features setProperties(final String featureId, final FeatureProperties properties); @Override Features removeProperties(final String featureId); @Override Features setProperty(final String featureId, final JsonPointer propertyPath, final JsonValue propertyValue); @Override Features removeProperty(final String featureId, final JsonPointer propertyPath); @Override int getSize(); @Override boolean isEmpty(); @Override Stream<Feature> stream(); @Override Iterator<Feature> iterator(); @Override JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }
@Test public void setSameExistingPropertiesReturnsSameFeatures() { final Features unchangedFeatures = underTest.setProperties(FLUX_CAPACITOR_ID, FLUX_CAPACITOR_PROPERTIES); assertThat(unchangedFeatures).isSameAs(underTest); }