test_class.declarator: KNOWN_SUBJECT_ID_1 = SubjectId.newInstance(SubjectIssuer.GOOGLE, "myself1")
test_class.modifier: private static final
test_class.original_string: private static final SubjectId KNOWN_SUBJECT_ID_1 = SubjectId.newInstance(SubjectIssuer.GOOGLE, "myself1");
test_class.type: SubjectId
test_class.var_name: KNOWN_SUBJECT_ID_1
test_class.declarator: KNOWN_SUBJECT_ID_2 = SubjectId.newInstance(SubjectIssuer.GOOGLE, "myself2")
test_class.modifier: private static final
test_class.original_string: private static final SubjectId KNOWN_SUBJECT_ID_2 = SubjectId.newInstance(SubjectIssuer.GOOGLE, "myself2");
test_class.type: SubjectId
test_class.var_name: KNOWN_SUBJECT_ID_2
test_class.declarator: SUBJECT_1 = ImmutableSubject.of(KNOWN_SUBJECT_ID_1)
test_class.modifier: private static final
test_class.original_string: private static final Subject SUBJECT_1 = ImmutableSubject.of(KNOWN_SUBJECT_ID_1);
test_class.type: Subject
test_class.var_name: SUBJECT_1
test_class.declarator: SUBJECT_2 = ImmutableSubject.of(KNOWN_SUBJECT_ID_2)
test_class.modifier: private static final
test_class.original_string: private static final Subject SUBJECT_2 = ImmutableSubject.of(KNOWN_SUBJECT_ID_2);
test_class.type: Subject
test_class.var_name: SUBJECT_2
test_class.file: model/policies/src/test/java/org/eclipse/ditto/model/policies/ImmutableSubjectsTest.java
test_class.identifier: ImmutableSubjectsTest
test_case.body: @Test
      public void createResourcesWithSamePathsShouldFail() {
          final Collection<Subject> subjectList = Arrays.asList(SUBJECT_1, SUBJECT_1);
  
          assertThatExceptionOfType(IllegalArgumentException.class)
                  .isThrownBy(() -> ImmutableSubjects.of(subjectList))
                  .withMessageStartingWith("There is more than one Subject with the ID")
                  .withNoCause();
      }
test_case.class_method_signature: ImmutableSubjectsTest.createResourcesWithSamePathsShouldFail()
test_case.full_signature: @Test public void createResourcesWithSamePathsShouldFail()
test_case.identifier: createResourcesWithSamePathsShouldFail
test_case.invocations: asList withNoCause withMessageStartingWith isThrownBy assertThatExceptionOfType of
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void createResourcesWithSamePathsShouldFail()
focal_class.declarator: subjects
focal_class.modifier: private final
focal_class.original_string: private final Map<SubjectId, Subject> subjects;
focal_class.type: Map<SubjectId, Subject>
focal_class.var_name: subjects
focal_class.file: model/policies/src/main/java/org/eclipse/ditto/model/policies/ImmutableSubjects.java
focal_class.identifier: ImmutableSubjects
focal_class.interfaces: implements Subjects
focal_class.class_method_signature: ImmutableSubjects.ImmutableSubjects(final Map<SubjectId, Subject> theSubjects)
focal_class.full_signature: private  ImmutableSubjects(final Map<SubjectId, Subject> theSubjects)
focal_class.identifier: ImmutableSubjects
focal_class.modifiers: private
focal_class.parameters: (final Map<SubjectId, Subject> theSubjects)
focal_class.signature:  ImmutableSubjects(final Map<SubjectId, Subject> theSubjects)
focal_class.class_method_signature: ImmutableSubjects.of(final Iterable<Subject> subjects)
focal_class.full_signature: public static ImmutableSubjects of(final Iterable<Subject> subjects)
focal_class.identifier: of
focal_class.modifiers: public static
focal_class.parameters: (final Iterable<Subject> subjects)
focal_class.return: ImmutableSubjects
focal_class.signature: ImmutableSubjects of(final Iterable<Subject> subjects)
focal_class.class_method_signature: ImmutableSubjects.fromJson(final JsonObject jsonObject)
focal_class.full_signature: public static ImmutableSubjects fromJson(final JsonObject jsonObject)
focal_class.identifier: fromJson
focal_class.modifiers: public static
focal_class.parameters: (final JsonObject jsonObject)
focal_class.return: ImmutableSubjects
focal_class.signature: ImmutableSubjects fromJson(final JsonObject jsonObject)
focal_class.class_method_signature: ImmutableSubjects.getSubject(final SubjectId subjectId)
focal_class.full_signature: @Override public Optional<Subject> getSubject(final SubjectId subjectId)
focal_class.identifier: getSubject
focal_class.modifiers: @Override public
focal_class.parameters: (final SubjectId subjectId)
focal_class.return: Optional<Subject>
focal_class.signature: Optional<Subject> getSubject(final SubjectId subjectId)
focal_class.class_method_signature: ImmutableSubjects.setSubject(final Subject subject)
focal_class.full_signature: @Override public Subjects setSubject(final Subject subject)
focal_class.identifier: setSubject
focal_class.modifiers: @Override public
focal_class.parameters: (final Subject subject)
focal_class.return: Subjects
focal_class.signature: Subjects setSubject(final Subject subject)
focal_class.class_method_signature: ImmutableSubjects.createNewSubjectsWithNewSubject(final Subject newSubject)
focal_class.full_signature: private Subjects createNewSubjectsWithNewSubject(final Subject newSubject)
focal_class.identifier: createNewSubjectsWithNewSubject
focal_class.modifiers: private
focal_class.parameters: (final Subject newSubject)
focal_class.return: Subjects
focal_class.signature: Subjects createNewSubjectsWithNewSubject(final Subject newSubject)
focal_class.class_method_signature: ImmutableSubjects.copySubjects()
focal_class.full_signature: private Map<SubjectId, Subject> copySubjects()
focal_class.identifier: copySubjects
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: Map<SubjectId, Subject>
focal_class.signature: Map<SubjectId, Subject> copySubjects()
focal_class.class_method_signature: ImmutableSubjects.removeSubject(final SubjectId subjectId)
focal_class.full_signature: @Override public Subjects removeSubject(final SubjectId subjectId)
focal_class.identifier: removeSubject
focal_class.modifiers: @Override public
focal_class.parameters: (final SubjectId subjectId)
focal_class.return: Subjects
focal_class.signature: Subjects removeSubject(final SubjectId subjectId)
focal_class.class_method_signature: ImmutableSubjects.getSize()
focal_class.full_signature: @Override public int getSize()
focal_class.identifier: getSize
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getSize()
focal_class.class_method_signature: ImmutableSubjects.isEmpty()
focal_class.full_signature: @Override public boolean isEmpty()
focal_class.identifier: isEmpty
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isEmpty()
focal_class.class_method_signature: ImmutableSubjects.toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_class.full_signature: @Override public JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_class.identifier: toJson
focal_class.modifiers: @Override public
focal_class.parameters: (final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_class.return: JsonObject
focal_class.signature: JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_class.class_method_signature: ImmutableSubjects.subjectsToJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_class.full_signature: private JsonObject subjectsToJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_class.identifier: subjectsToJson
focal_class.modifiers: private
focal_class.parameters: (final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_class.return: JsonObject
focal_class.signature: JsonObject subjectsToJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_class.class_method_signature: ImmutableSubjects.iterator()
focal_class.full_signature: @Override public Iterator<Subject> iterator()
focal_class.identifier: iterator
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Iterator<Subject>
focal_class.signature: Iterator<Subject> iterator()
focal_class.class_method_signature: ImmutableSubjects.stream()
focal_class.full_signature: @Override public Stream<Subject> stream()
focal_class.identifier: stream
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Stream<Subject>
focal_class.signature: Stream<Subject> stream()
focal_class.class_method_signature: ImmutableSubjects.equals(final Object o)
focal_class.full_signature: @SuppressWarnings({"squid:MethodCyclomaticComplexity", "squid:S1067"}) @Override public boolean equals(final Object o)
focal_class.identifier: equals
focal_class.modifiers: @SuppressWarnings({"squid:MethodCyclomaticComplexity", "squid:S1067"}) @Override public
focal_class.parameters: (final Object o)
focal_class.return: boolean
focal_class.signature: boolean equals(final Object o)
focal_class.class_method_signature: ImmutableSubjects.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_class.class_method_signature: ImmutableSubjects.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_method.body: public static ImmutableSubjects of(final Iterable<Subject> subjects) {
          checkNotNull(subjects, "subjects");
  
          final Map<SubjectId, Subject> subjectsMap = new HashMap<>();
          subjects.forEach(subject -> {
              final Subject existingSubject = subjectsMap.put(subject.getId(), subject);
              if (null != existingSubject) {
                  final String msgTemplate = "There is more than one Subject with the ID <{0}>!";
                  throw new IllegalArgumentException(MessageFormat.format(msgTemplate, subject.getId()));
              }
          });
  
          return new ImmutableSubjects(subjectsMap);
      }
focal_method.class_method_signature: ImmutableSubjects.of(final Iterable<Subject> subjects)
focal_method.full_signature: public static ImmutableSubjects of(final Iterable<Subject> subjects)
focal_method.identifier: of
focal_method.invocations: checkNotNull forEach put getId format getId
focal_method.modifiers: public static
focal_method.parameters: (final Iterable<Subject> subjects)
focal_method.return: ImmutableSubjects
focal_method.signature: ImmutableSubjects of(final Iterable<Subject> subjects)