### Question:
GenericGermanyKnxProjectCharacteristics extends KnxProjectCharacteristics { @Override public GroupAddress findMatchingStatusGroupAddress(GroupAddress primarySwitchGroupAddress) { GroupAddress candidate = groupAddressByThreePartAddress .get(GroupAddress.formatAsThreePartAddress(primarySwitchGroupAddress.getAddressInt() + 3)); if (candidate != null) { LOG.debug("Evaluating potential candidate for GA {}: {}", primarySwitchGroupAddress, candidate); if (isMatchingStatus(candidate, primarySwitchGroupAddress)) { return candidate; } } List<GroupAddressRange> statusRanges = groupAddressRangeIndex.entrySet().stream() .filter((e) -> containsStatusTerm(e.getValue().nameTerms)).map(Entry::getKey).collect(toList()); for (GroupAddressRange statusRange : statusRanges) { int part1, part2, part3; if (statusRange.getParent() == null) { part1 = getAddressPart1(statusRange.getStartInt()); part2 = getAddressPart2(primarySwitchGroupAddress.getAddressInt()); part3 = getAddressPart3(primarySwitchGroupAddress.getAddressInt()); } else { part1 = getAddressPart1(primarySwitchGroupAddress.getAddressInt()); part2 = getAddressPart2(statusRange.getStartInt()); part3 = getAddressPart3(primarySwitchGroupAddress.getAddressInt()); } String potentialStatusGa = formatAsThreePartAddress(part1, part2, part3); candidate = groupAddressByThreePartAddress.get(potentialStatusGa); if (candidate != null) { LOG.debug("Evaluating potential candidate for GA {}: {}", primarySwitchGroupAddress, candidate); if (isMatchingStatus(candidate, primarySwitchGroupAddress)) { return candidate; } } } return null; }  @Override GroupAddress findMatchingBrightnessGroupAddress(GroupAddress primarySwitchGroupAddress); @Override GroupAddress findMatchingBrightnessStatusGroupAddress(GroupAddress primarySwitchGroupAddress); @Override GroupAddress findMatchingDimGroupAddress(GroupAddress primarySwitchGroupAddress); @Override GroupAddress findMatchingStatusGroupAddress(GroupAddress primarySwitchGroupAddress); @Override boolean isLight(GroupAddress ga); @Override boolean isPrimarySwitch(GroupAddress ga); @Override void learn(List<GroupAddress> groupAddresses);  }### Answer:
@Test public void findMatchingStatusGroupAddress_pattern_block() throws Exception { GroupAddress primary = ga(1, 0, 1, "Licht Küche Ein/Aus", Switch.getValue()); GroupAddress status = ga(1, 0, 4, "Licht Küche Status", State.getValue()); assertEquals(status, characteristics.findMatchingStatusGroupAddress(primary)); }
@Test public void findMatchingStatusGroupAddress_pattern_group() throws Exception { GroupAddressRange lightsRange = new GroupAddressRange(null, null, 2048, 4095, "Lichter", null); GroupAddressRange statusRange = new GroupAddressRange(null, null, 20480, 22527, "Rückmelde-/Statusobjekte", null); GroupAddress primary = ga(lightsRange, 1, 0, 1, "Licht Küche Ein/Aus", Switch.getValue()); GroupAddress status = ga(statusRange, 10, 0, 1, "Licht Küche Status", State.getValue()); assertEquals(status, characteristics.findMatchingStatusGroupAddress(primary)); }