test_class.file: cepheus-broker/src/test/java/com/orange/cepheus/broker/PatternsTest.java
test_class.identifier: PatternsTest
test_case.body: @Test
      public void getFilterEntityIdWithNoTypeTest() {
          EntityId entityIdRegisterOrSubscribe = new EntityId("B", "", false);
          EntityId entityIdsearch = new EntityId("A|B", "string", true);
          Patterns patterns = new Patterns();
  
          Predicate<EntityId> entityIdPredicate = patterns.getFilterEntityId(entityIdsearch);
          assertFalse(entityIdPredicate.test(entityIdRegisterOrSubscribe));
      }
test_case.class_method_signature: PatternsTest.getFilterEntityIdWithNoTypeTest()
test_case.full_signature: @Test public void getFilterEntityIdWithNoTypeTest()
test_case.identifier: getFilterEntityIdWithNoTypeTest
test_case.invocations: getFilterEntityId assertFalse test
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getFilterEntityIdWithNoTypeTest()
focal_class.declarator: cachedPatterns = new ConcurrentHashMap<>()
focal_class.modifier: private
focal_class.original_string: private Map<String, Pattern> cachedPatterns = new ConcurrentHashMap<>();
focal_class.type: Map<String, Pattern>
focal_class.var_name: cachedPatterns
focal_class.file: cepheus-broker/src/main/java/com/orange/cepheus/broker/Patterns.java
focal_class.identifier: Patterns
focal_class.class_method_signature: Patterns.getPattern(final EntityId entityId)
focal_class.full_signature: public Pattern getPattern(final EntityId entityId)
focal_class.identifier: getPattern
focal_class.modifiers: public
focal_class.parameters: (final EntityId entityId)
focal_class.return: Pattern
focal_class.signature: Pattern getPattern(final EntityId entityId)
focal_class.class_method_signature: Patterns.hasType(final EntityId entityId)
focal_class.full_signature: public boolean hasType(final EntityId entityId)
focal_class.identifier: hasType
focal_class.modifiers: public
focal_class.parameters: (final EntityId entityId)
focal_class.return: boolean
focal_class.signature: boolean hasType(final EntityId entityId)
focal_class.class_method_signature: Patterns.getFilterEntityId(EntityId searchEntityId)
focal_class.full_signature: public Predicate<EntityId> getFilterEntityId(EntityId searchEntityId)
focal_class.identifier: getFilterEntityId
focal_class.modifiers: public
focal_class.parameters: (EntityId searchEntityId)
focal_class.return: Predicate<EntityId>
focal_class.signature: Predicate<EntityId> getFilterEntityId(EntityId searchEntityId)
focal_method.body: public Predicate<EntityId> getFilterEntityId(EntityId searchEntityId) {
          final boolean searchType = hasType(searchEntityId);
          final Pattern pattern = getPattern(searchEntityId);
  
          Predicate<EntityId> filterEntityId = entityId -> {
              // Match by type if any
              if (!searchType) {
                  if (hasType(entityId)) {
                      return false;
                  }
              } else if (!searchEntityId.getType().equals(entityId.getType())) {
                  return false;
              }
  
              // Match pattern if any
              if (pattern != null) {
                  // Match two patterns by equality
                  if (entityId.getIsPattern()) {
                      return searchEntityId.getId().equals(entityId.getId());
                  }
                  return pattern.matcher(entityId.getId()).find();
              } else {
                  if (entityId.getIsPattern()) {
                      return getPattern(entityId).matcher(searchEntityId.getId()).find();
                  }
                  // Match two ids by equality
                  return searchEntityId.getId().equals(entityId.getId());
              }
          };
  
          return filterEntityId;
      }
focal_method.class_method_signature: Patterns.getFilterEntityId(EntityId searchEntityId)
focal_method.full_signature: public Predicate<EntityId> getFilterEntityId(EntityId searchEntityId)
focal_method.identifier: getFilterEntityId
focal_method.invocations: hasType getPattern hasType equals getType getType getIsPattern equals getId getId find matcher getId getIsPattern find matcher getPattern getId equals getId getId
focal_method.modifiers: public
focal_method.parameters: (EntityId searchEntityId)
focal_method.return: Predicate<EntityId>
focal_method.signature: Predicate<EntityId> getFilterEntityId(EntityId searchEntityId)