test_class.file: mubench/src/test/java/de/tu_darmstadt/stg/mudetect/MissingDefPrefixNoViolationPredicateTest.java
test_class.identifier: MissingDefPrefixNoViolationPredicateTest
test_case.body: @Test
      public void missingDefPrefixWithPredecessorIsNoViolation() {
          TestAUGBuilder pattern = buildAUG().withActionNodes("create()", "use()").withDataNodes("Creator", "Object")
                  .withEdge("Creator", RECEIVER, "create()")
                  .withEdge("create()", DEFINITION, "Object")
                  .withEdge("Object", RECEIVER, "use()").withEdge("create()", RECEIVER, "use()");
          TestAUGBuilder target = buildAUG().withActionNodes("use()").withDataNodes("Object")
                  .withEdge("Object", RECEIVER, "use()");
          TestOverlapBuilder overlap = buildOverlap(pattern, target).withNodes("use()", "Object")
                  .withEdge("Object", RECEIVER, "use()");
  
          Optional<Boolean> decision = new MissingDefPrefixNoViolationPredicate().apply(overlap.build());
  
          assertThat(decision, is(Optional.of(false)));
      }
test_case.class_method_signature: MissingDefPrefixNoViolationPredicateTest.missingDefPrefixWithPredecessorIsNoViolation()
test_case.full_signature: @Test public void missingDefPrefixWithPredecessorIsNoViolation()
test_case.identifier: missingDefPrefixWithPredecessorIsNoViolation
test_case.invocations: withEdge withEdge withEdge withEdge withDataNodes withActionNodes buildAUG withEdge withDataNodes withActionNodes buildAUG withEdge withNodes buildOverlap apply build assertThat is of
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void missingDefPrefixWithPredecessorIsNoViolation()
focal_class.file: mubench/src/main/java/de/tu_darmstadt/stg/mudetect/MissingDefPrefixNoViolationPredicate.java
focal_class.identifier: MissingDefPrefixNoViolationPredicate
focal_class.interfaces: implements ViolationPredicate
focal_class.class_method_signature: MissingDefPrefixNoViolationPredicate.apply(Overlap overlap)
focal_class.full_signature: @Override public Optional<Boolean> apply(Overlap overlap)
focal_class.identifier: apply
focal_class.modifiers: @Override public
focal_class.parameters: (Overlap overlap)
focal_class.return: Optional<Boolean>
focal_class.signature: Optional<Boolean> apply(Overlap overlap)
focal_class.class_method_signature: MissingDefPrefixNoViolationPredicate.haveDefiningSource(Set<Edge> missingDirectConnectionEdges)
focal_class.full_signature: private boolean haveDefiningSource(Set<Edge> missingDirectConnectionEdges)
focal_class.identifier: haveDefiningSource
focal_class.modifiers: private
focal_class.parameters: (Set<Edge> missingDirectConnectionEdges)
focal_class.return: boolean
focal_class.signature: boolean haveDefiningSource(Set<Edge> missingDirectConnectionEdges)
focal_class.class_method_signature: MissingDefPrefixNoViolationPredicate.haveSingleSource(Set<Edge> missingDirectConnectionEdges)
focal_class.full_signature: private boolean haveSingleSource(Set<Edge> missingDirectConnectionEdges)
focal_class.identifier: haveSingleSource
focal_class.modifiers: private
focal_class.parameters: (Set<Edge> missingDirectConnectionEdges)
focal_class.return: boolean
focal_class.signature: boolean haveSingleSource(Set<Edge> missingDirectConnectionEdges)
focal_class.class_method_signature: MissingDefPrefixNoViolationPredicate.connectsToMappedNode(Overlap overlap, Edge edge)
focal_class.full_signature: private boolean connectsToMappedNode(Overlap overlap, Edge edge)
focal_class.identifier: connectsToMappedNode
focal_class.modifiers: private
focal_class.parameters: (Overlap overlap, Edge edge)
focal_class.return: boolean
focal_class.signature: boolean connectsToMappedNode(Overlap overlap, Edge edge)
focal_method.body: @Override
      public Optional<Boolean> apply(Overlap overlap) {
          Set<Edge> missingDirectConnectionEdges = overlap.getMissingEdges().stream()
                  .filter(Edge::isDirect)
                  .filter(edge -> connectsToMappedNode(overlap, edge))
                  .collect(Collectors.toSet());
  
          if (haveSingleSource(missingDirectConnectionEdges) && haveDefiningSource(missingDirectConnectionEdges)) {
              return Optional.of(false);
          } else {
              return Optional.empty();
          }
      }
focal_method.class_method_signature: MissingDefPrefixNoViolationPredicate.apply(Overlap overlap)
focal_method.full_signature: @Override public Optional<Boolean> apply(Overlap overlap)
focal_method.identifier: apply
focal_method.invocations: collect filter filter stream getMissingEdges connectsToMappedNode toSet haveSingleSource haveDefiningSource of empty
focal_method.modifiers: @Override public
focal_method.parameters: (Overlap overlap)
focal_method.return: Optional<Boolean>
focal_method.signature: Optional<Boolean> apply(Overlap overlap)