### Question:
Predicates { public static boolean isHubRequired(Model m) { if(m == null || !m.supports(DeviceAdvancedCapability.NAMESPACE)) { return false; } String prot = DeviceAdvancedModel.getProtocol(m); if(StringUtils.isBlank(prot)) { return false; } switch(prot) { case Constants.Protocol.ZIGBEE: case Constants.Protocol.ZWAVE: case Constants.Protocol.SERCOMM: return true; default: return false; } } private  Predicates(); static boolean isSupportedModel(Model m, boolean whitelisted, @Nullable ProductCatalogEntry pm); static boolean isHubOffline(Model m); static boolean isHubRequired(Model m); static boolean isDeviceOffline(Model m, boolean hubOffline);  }### Answer:
@Test public void testHubRequired() { assertFalse(Predicates.isHubRequired(null)); assertFalse(Predicates.isHubRequired(new SimpleModel(ModelFixtures.createPersonAttributes()))); Model m = ModelFixtures.buildDeviceAttributes(SwitchCapability.NAMESPACE).remove(DeviceAdvancedCapability.ATTR_PROTOCOL).toModel(); assertFalse(Predicates.isHubRequired(m)); m = ModelFixtures.buildDeviceAttributes(SwitchCapability.NAMESPACE).put(DeviceAdvancedCapability.ATTR_PROTOCOL, Constants.Protocol.SERCOMM).toModel(); assertTrue(Predicates.isHubRequired(m)); m = ModelFixtures.buildDeviceAttributes(SwitchCapability.NAMESPACE).put(DeviceAdvancedCapability.ATTR_PROTOCOL, Constants.Protocol.ZIGBEE).toModel(); assertTrue(Predicates.isHubRequired(m)); m = ModelFixtures.buildDeviceAttributes(SwitchCapability.NAMESPACE).put(DeviceAdvancedCapability.ATTR_PROTOCOL, Constants.Protocol.ZWAVE).toModel(); assertTrue(Predicates.isHubRequired(m)); m = ModelFixtures.buildDeviceAttributes(SwitchCapability.NAMESPACE).put(DeviceAdvancedCapability.ATTR_PROTOCOL, "IPCD").toModel(); assertFalse(Predicates.isHubRequired(m)); }