ImmutableSource implements Source { @Override public PayloadMapping getPayloadMapping() { return payloadMapping; } private  ImmutableSource(final Builder builder); @Override Set<String> getAddresses(); @Override int getConsumerCount(); @Override AuthorizationContext getAuthorizationContext(); @Override int getIndex(); @Override Optional<Integer> getQos(); @Override Optional<Enforcement> getEnforcement(); @Override Optional<FilteredAcknowledgementRequest> getAcknowledgementRequests(); @Override Optional<HeaderMapping> getHeaderMapping(); @Override PayloadMapping getPayloadMapping(); @Override Optional<ReplyTarget> getReplyTarget(); @Override boolean isReplyTargetEnabled(); @Override JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate); static Source fromJson(final JsonObject jsonObject, final int index); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }
@Test public void addMappingToExistingSource() { final Source sourceWithMapping = new ImmutableSource.Builder(SOURCE_WITH_AUTH_CONTEXT) .payloadMapping(ConnectivityModelFactory.newPayloadMapping("mapping")) .build(); assertThat(sourceWithMapping.getPayloadMapping().getMappings()).containsExactly("mapping"); }