### Question:
Predicates { public static boolean isHubOffline(Model m) { return m != null && m.supports(HubCapability.NAMESPACE) && Objects.equals(HubCapability.STATE_DOWN, HubModel.getState(m)); } 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 testHubOffline() { assertFalse(Predicates.isHubOffline(null)); assertFalse(Predicates.isHubOffline(ModelFixtures.buildContactAttributes().toModel())); Map<String,Object> hub = ModelFixtures.createHubAttributes(); assertFalse(Predicates.isHubOffline(new SimpleModel(hub))); hub.put(HubCapability.ATTR_STATE, HubCapability.STATE_DOWN); assertTrue(Predicates.isHubOffline(new SimpleModel(hub))); }