/*
 * JBoss, Home of Professional Open Source.
 * Copyright 2012 Red Hat, Inc., and individual contributors
 * as indicated by the @author tags.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.undertow.util;

import org.junit.Test;

/**
 * @author Stuart Douglas
 */
public class SecureHashMapTestCase {

    @Test
    public void testGetNonExistentDoesNotNPE(){
        final SecureHashMap<String, String> map = new SecureHashMap<String, String>();
        map.get("nothing");
    }
}

@@ -739,22 +739,216 @@
 ort 
-org.junit.Test
+io.undertow.server.session.SecureRandomSessionIdGenerator;%0Aimport io.undertow.server.session.SessionIdGenerator;%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map
 ;%0A%0A/
@@ -1074,16 +1074,17 @@
 NotNPE()
+ 
 %7B%0A      
@@ -1196,12 +1196,830 @@
 %22);%0A
-
     %7D%0A
+%0A%0A    @Test%0A    public void testLotsOfPutsAndGets() %7B%0A%0A        SessionIdGenerator generator = new SecureRandomSessionIdGenerator();%0A        final Map%3CString, String%3E reference = new HashMap%3CString, String%3E();%0A        final SecureHashMap%3CString, String%3E map = new SecureHashMap%3CString, String%3E();%0A        for (int i = 0; i %3C 10000; ++i) %7B%0A            String key = generator.createSessionId();%0A            String value = generator.createSessionId();%0A            map.put(key, value);%0A            reference.put(key, value);%0A        %7D%0A        for (Map.Entry%3CString, String%3E entry : reference.entrySet()) %7B%0A            Assert.assertEquals(entry.getValue(), map.get(entry.getKey()));%0A            Assert.assertEquals(entry.getValue(), map.remove(entry.getKey()));%0A        %7D%0A        Assert.assertEquals(0, map.size());%0A    %7D%0A%0A%0A
 %7D%0A

Add to secure hash map test