/*
 * 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.tamaya;

import java.util.Optional;

/**
 * Test Configuration class, that is used to testdata the default methods provided by the API.
 */
public class TestConfiguration implements Configuration{

    @Override
    public Optional<String> get(String key) {
        if("long".equals(key)){
            return Optional.ofNullable(String.valueOf(Long.MAX_VALUE));
        }
        else if("int".equals(key)){
            return Optional.ofNullable(String.valueOf(Integer.MAX_VALUE));
        }
        else if("double".equals(key)){
            return Optional.ofNullable(String.valueOf(Double.MAX_VALUE));
        }
        else if("float".equals(key)){
            return Optional.ofNullable(String.valueOf(Float.MAX_VALUE));
        }
        else if("short".equals(key)){
            return Optional.ofNullable(String.valueOf(Short.MAX_VALUE));
        }
        else if("byte".equals(key)){
            return Optional.ofNullable(String.valueOf(Byte.MAX_VALUE));
        }
        else if("booleanTrue".equals(key)){
            return Optional.ofNullable("true");
        }
        else if("booleanFalse".equals(key)){
            return Optional.ofNullable("false");
        }
        else if("String".equals(key)){
            return Optional.ofNullable("aStringValue");
        }
        return Optional.ofNullable("noValue");
    }

    @Override
    public <T> Optional<T> get(String key, Class<T> type) {
        if(type.equals(Long.class)){
            return Optional.class.cast(Optional.ofNullable(Long.MAX_VALUE));
        }
        else if(type.equals(Integer.class)){
            return Optional.class.cast(Optional.ofNullable(Integer.MAX_VALUE));
        }
        else if(type.equals(Double.class)){
            return Optional.class.cast(Optional.ofNullable(Double.MAX_VALUE));
        }
        else if(type.equals(Float.class)){
            return Optional.class.cast(Optional.ofNullable(Float.MAX_VALUE));
        }
        else if(type.equals(Short.class)){
            return Optional.class.cast(Optional.ofNullable(Short.MAX_VALUE));
        }
        else if(type.equals(Byte.class)){
            return Optional.class.cast(Optional.ofNullable(Byte.MAX_VALUE));
        }
        else if(type.equals(Boolean.class)){
            if("booleanTrue".equals(key)) {
                return Optional.class.cast(Optional.ofNullable(Boolean.TRUE));
            }
            else{
                return Optional.class.cast(Optional.ofNullable(Boolean.FALSE));
            }
        }
        else if(type.equals(String.class)){
            return Optional.class.cast(Optional.ofNullable("aStringValue"));
        }
        throw new ConfigException("No such property: " + key);
    }

}

@@ -829,16 +829,64 @@
 amaya;%0A%0A
+import java.util.HashMap;%0Aimport java.util.Map;%0A
 import j
@@ -1074,974 +1074,617 @@
     
-@Override%0A    public Optional%3CString%3E get(String key) %7B%0A        if(%22long%22.equals(key))%7B%0A            return Optional.ofNullable(String.valueOf(Long.MAX_VALUE));%0A        %7D%0A        else if(%22int%22.equals(key))%7B%0A            return Optional.ofNullable(String.valueOf(Integer.MAX_VALUE));%0A        %7D%0A        else if(%22double%22.equals(key))%7B%0A            return Optional.ofNullable(String.valueOf(Double.MAX_VALUE));%0A        %7D%0A        else if(%22float%22.equals(key))%7B%0A            return Optional.ofNullable(String.valueOf(Float.MAX_VALUE));%0A        %7D%0A        else if(%22short%22.equals(key))%7B%0A            return Optional.ofNullable(String.valueOf(Short.MAX_VALUE));%0A        %7D%0A        else if(%22byte%22.equals(key))%7B%0A            return Optional.ofNullable(String.valueOf(Byte.MAX_VALUE));%0A        %7D%0A        else if(%22booleanTrue%22.equals(key))%7B%0A            return Optional.ofNullable(%22true%22);%0A        %7D%0A        else if(%22booleanFalse%22.equals(key))%7B%0A            return Optional.ofNullable(%22fals
+private static final Map%3CString, String%3E VALUES;%0A    static %7B%0A        VALUES = new HashMap%3CString, String%3E();%0A        VALUES.put(%22long%22, String.valueOf(Long.MAX_VALUE));%0A        VALUES.put(%22int%22, String.valueOf(Integer.MAX_VALUE));%0A        VALUES.put(%22double%22, String.valueOf(Double.MAX_VALUE));%0A        VALUES.put(%22float%22, String.valueOf(Float.MAX_VALUE));%0A        VALUES.put(%22short%22, String.valueOf(Short.MAX_VALUE));%0A        VALUES.put(%22byte%22, String.valueOf(Byte.MAX_VALUE));%0A        VALUES.put(%22booleanTrue%22, %22true%22);%0A        VALUES.put(%22booleanFalse%22, %22false%22);%0A        VALUES.put(%22String%22, %22aStringValu
 e%22);
@@ -1692,118 +1692,70 @@
     
- 
-   
 %7D
+%0A
 %0A    
-    else if(%22String%22.equals(key))%7B%0A            return Optional.ofNullable(%22aStringValue%22);%0A        %7D
+@Override%0A    public Optional%3CString%3E get(String key) %7B
 %0A   
@@ -1790,17 +1790,23 @@
 ble(
-%22noValue%22
+VALUES.get(key)
 );%0A 
@@ -3173,10 +3173,100 @@
 %0A    %7D%0A%0A
+    @Override%0A    public Map%3CString, String%3E getProperties() %7B%0A        return null;%0A    %7D%0A
 %7D%0A

fix TestConfiguration - did not even compile ...