Make test api extend system in sdk_library.go

The test stubs for the "main" android API are being changed to
incude @SystemApi annotated APIs. Update sdk_library to make modules
and optional libraries follow the same principle.

Bug: 129133308
Test: presubmit
Exempt-From-Owner-Approval: cp
Change-Id: I7bd940e1a8127d954d30c532c74d684a5ba9d33c
Merged-In: I7bd940e1a8127d954d30c532c74d684a5ba9d33c
(cherry picked from commit 13dbaac5b6cc4f135404d2954541fd44b09e89e0)
(cherry picked from commit 4fe970f3036b74b7e4a5aeff1dd04a9d28a1355f)
diff --git a/java/sdk_library.go b/java/sdk_library.go
index 022c3d7..f26f61c 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -251,7 +251,7 @@
 	})
 	apiScopeTest = initApiScope(&apiScope{
 		name:                "test",
-		extends:             apiScopePublic,
+		extends:             apiScopeSystem,
 		legacyEnabledStatus: (*SdkLibrary).generateTestAndSystemScopesByDefault,
 		scopeSpecificProperties: func(module *SdkLibrary) *ApiScopeProperties {
 			return &module.sdkLibraryProperties.Test