/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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 org.apache.commons.lang3.text.translate;

import junit.framework.TestCase;

/**
 * Unit tests for {@link org.apache.commons.lang3.text.translate.EntityArrays}.
 * @version $Id$
 */
public class EntityArraysTest extends TestCase {

    public void testConstructorExists() {
        new EntityArrays();
    }
}

@@ -849,16 +849,65 @@
 slate;%0A%0A
+import java.util.HashSet;%0Aimport java.util.Set;%0A%0A
 import j
@@ -1163,10 +1163,1341 @@
 ;%0A    %7D%0A
+    %0A    // LANG-659 - check arrays for duplicate entries%0A    public void testHTML40_EXTENDED_ESCAPE()%7B%0A        Set%3CString%3E col0 = new HashSet%3CString%3E();%0A        Set%3CString%3E col1 = new HashSet%3CString%3E();%0A        String %5B%5D%5B%5D sa = EntityArrays.HTML40_EXTENDED_ESCAPE();%0A        for(int i =0; i %3Csa.length; i++)%7B%0A            assertTrue(%22Already added entry 0: %22+i+%22 %22+sa%5Bi%5D%5B0%5D,col0.add(sa%5Bi%5D%5B0%5D));%0A            assertTrue(%22Already added entry 1: %22+i+%22 %22+sa%5Bi%5D%5B1%5D,col1.add(sa%5Bi%5D%5B1%5D));%0A        %7D%0A    %7D%0A    %0A   // LANG-658 - check arrays for duplicate entries%0A    public void testISO8859_1_ESCAPE()%7B%0A        Set%3CString%3E col0 = new HashSet%3CString%3E();%0A        Set%3CString%3E col1 = new HashSet%3CString%3E();%0A        String %5B%5D%5B%5D sa = EntityArrays.ISO8859_1_ESCAPE();%0A        boolean success = true;%0A        for(int i =0; i %3Csa.length; i++)%7B%0A            boolean add0 = col0.add(sa%5Bi%5D%5B0%5D);%0A            boolean add1 = col1.add(sa%5Bi%5D%5B1%5D);%0A            if (!add0) %7B %0A                success = false;%0A                System.out.println(%22Already added entry 0: %22+i+%22 %22+sa%5Bi%5D%5B0%5D+%22 %22+sa%5Bi%5D%5B1%5D);%0A            %7D%0A            if (!add1) %7B%0A                success = false;%0A                System.out.println(%22Already added entry 1: %22+i+%22 %22+sa%5Bi%5D%5B0%5D+%22 %22+sa%5Bi%5D%5B1%5D);%0A            %7D%0A        %7D%0A        assertTrue(%22One or more errors detected%22,success);%0A    %7D%0A    %0A    %0A
 %7D%0A

Add tests to check for duplicate entries in the conversion tables