@@ -0,0 +1,1768 @@
+/* Copyright 2006 The Apache Software Foundation or its licensors, as applicable%0A * %0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A * %0A *     http://www.apache.org/licenses/LICENSE-2.0%0A * %0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.apache.harmony.luni.tests.java.lang;%0A%0Aimport java.security.Permission;%0Aimport java.util.HashSet;%0Aimport java.util.Set;%0A%0Aclass MutableSecurityManager extends SecurityManager %7B%0A%0A    static final RuntimePermission SET_SECURITY_MANAGER = new RuntimePermission(%22setSecurityManager%22);%0A    %0A    private final Set%3CPermission%3E permissions;%0A%0A    public MutableSecurityManager() %7B%0A        super();%0A        this.permissions = new HashSet%3CPermission%3E();%0A    %7D%0A    %0A    public MutableSecurityManager(Permission... permissions) %7B%0A        this();%0A        for (int i = 0; i %3C permissions.length; i++) %7B%0A            this.permissions.add(permissions%5Bi%5D);%0A        %7D%0A    %7D%0A%0A    void addPermission(Permission permission) %7B%0A        permissions.add(permission);%0A    %7D%0A%0A    void removePermission(Permission permission) %7B%0A        permissions.remove(permission);%0A    %7D%0A%0A    void clearPermissions() %7B%0A        permissions.clear();%0A    %7D%0A%0A    @Override%0A    public void checkPermission(Permission permission) %7B%0A        if (permissions.contains(permission)) %7B%0A            return;%0A        %7D%0A        super.checkPermission(permission);%0A    %7D%0A%7D%0A

Add MutableSecurityManager for helping SecurityManager tests.