ApiClassAnnotationConfig { public void setAudiencesIfSpecified(String[] audiences) { if (!AnnotationUtil.isUnspecified(audiences)) { config.setAudiences(Arrays.asList(audiences)); } } ApiClassAnnotationConfig(ApiClassConfig config); void setResourceIfNotEmpty(String resource); void setAuthLevelIfSpecified(AuthLevel authLevel); void setScopesIfSpecified(String[] scopes); void setAudiencesIfSpecified(String[] audiences); void setIssuerAudiencesIfSpecified(ApiIssuerAudienceConfig issuerAudiences); void setClientIdsIfSpecified(String[] clientIds); void setAuthenticatorsIfSpecified(Class<? extends Authenticator>[] authenticators); void setPeerAuthenticatorsIfSpecified(
      Class<? extends PeerAuthenticator>[] peerAuthenticators); void setUseDatastoreIfSpecified(AnnotationBoolean useDatastore); void setApiKeyRequiredIfSpecified(AnnotationBoolean apiKeyRequired);  }
@Test public void testSetAudiencesIfSpecified() throws Exception { String[] audiences = {"foo", "bar"}; annotationConfig.setAudiencesIfSpecified(audiences); Mockito.verify(config).setAudiences(Arrays.asList(audiences)); }
@Test public void testSetAudiencesIfSpecified_empty() throws Exception { String[] empty = {}; annotationConfig.setAudiencesIfSpecified(empty); Mockito.verify(config).setAudiences(Arrays.asList(empty)); }
@Test public void testSetAudiencesIfSpecified_unspecified() throws Exception { annotationConfig.setAudiencesIfSpecified(null); Mockito.verifyZeroInteractions(config); String[] unspecified = {Api.UNSPECIFIED_STRING_FOR_LIST}; annotationConfig.setAudiencesIfSpecified(unspecified); Mockito.verifyZeroInteractions(config); String[] audiences = {"bleh", "more bleh"}; annotationConfig.setAudiencesIfSpecified(audiences); annotationConfig.setAudiencesIfSpecified(unspecified); Mockito.verify(config).setAudiences(Arrays.asList(audiences)); Mockito.verifyNoMoreInteractions(config); }