### Question:
GatewayApiDefinitionManager { public static boolean isValidApi(ApiDefinition apiDefinition) { return apiDefinition != null && StringUtil.isNotBlank(apiDefinition.getApiName()) && apiDefinition.getPredicateItems() != null; }  static void register2Property(SentinelProperty<Set<ApiDefinition>> property); static boolean loadApiDefinitions(Set<ApiDefinition> apiDefinitions); static ApiDefinition getApiDefinition(final String apiName); static Set<ApiDefinition> getApiDefinitions(); static boolean isValidApi(ApiDefinition apiDefinition);  }### Answer:
@Test public void testIsValidApi() { ApiDefinition bad1 = new ApiDefinition(); ApiDefinition bad2 = new ApiDefinition("foo"); ApiDefinition good1 = new ApiDefinition("foo") .setPredicateItems(Collections.<ApiPredicateItem>singleton(new ApiPathPredicateItem() .setPattern("/abc") )); assertFalse(GatewayApiDefinitionManager.isValidApi(bad1)); assertFalse(GatewayApiDefinitionManager.isValidApi(bad2)); assertTrue(GatewayApiDefinitionManager.isValidApi(good1)); }