// Path: android/tweakr/src/main/java/com/google/tweakr/types/DefaultValueTypeConverter.java
// public class DefaultValueTypeConverter implements ValueTypeConverter {
// 
//     @Override
//     public ValueType getType(Class<?> fieldType) {
//         if (fieldType.isArray()) {
//             return new ArrayValueType(getType(fieldType.getComponentType()));
//         }
// 
//         if (fieldType == float.class || fieldType == double.class || fieldType == Float.class || fieldType == Double.class) {
//             return new PrimitiveValueType(PrimitiveValueType.TYPE_FLOAT);
//         } else if (fieldType == int.class || fieldType == long.class || fieldType == Integer.class || fieldType == Long.class) {
//             return new PrimitiveValueType(PrimitiveValueType.TYPE_INT);
//         } else if (fieldType == boolean.class || fieldType == Boolean.class) {
//             return new PrimitiveValueType(PrimitiveValueType.TYPE_BOOLEAN);
//         } else if (fieldType.isAssignableFrom(String.class)) {
//             return new PrimitiveValueType(PrimitiveValueType.TYPE_STRING);
//         } else if (fieldType.isEnum()) {
//             return new EnumValueType(fieldType);
//         }
// 
//         return new PrimitiveValueType(PrimitiveValueType.TYPE_UNKNOWN);
//     }
// }
// 
// Path: android/tweakr/src/main/java/com/google/tweakr/types/ValueType.java
// public interface ValueType {
//     /**
//      * Simple name of the type. Used to select an appropriate UI.
//      */
//     String getName();
// 
//     /**
//      * A default value if one cannot be determined.
//      */
//     Object getDefault();
// 
//     /**
//      * Safely convert a value from Firebase into the correct type.
//      */
//     Object convert(Object newValue);
// 
//     /**
//      * For enum fields or other fields you want to restrict to only certain choices.
//      *
//      * @return An array of String representations of all possible values to choose from.
//      */
//     default List<String> getPossibleValues() {
//         return null;
//     }
// }
// 
// Path: android/tweakr/src/main/java/com/google/tweakr/types/VoidValueType.java
// public class VoidValueType implements ValueType {
// 
//     @Override
//     public String getName() {
//         return "void";
//     }
// 
//     @Override
//     public Object getDefault() {
//         return null;
//     }
// 
//     @Override
//     public Object convert(Object newValue) {
//         return null;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
//         ValueType that = (ValueType) o;
//         return getName().equals(that.getName());
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(getName());
//     }
// }


import static org.mockito.Mockito.verify;
import com.google.tweakr.annotations.Tweak;
import com.google.tweakr.types.DefaultValueTypeConverter;
import com.google.tweakr.types.ValueType;
import com.google.tweakr.types.VoidValueType;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.isNull;
// Copyright 2019 Google LLC
//
// 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 com.google.tweakr;




/**
 * Example local unit test, which will execute on the development machine (host).
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
public class TweakrRegistryTest {

    private static final String TEST_STRING = "this is a test";
    private static final int TEST_INT = 134426;
    private static final Float TEST_FLOAT = 434.324f;

    private enum TestEnum {
        SOMETHING,
        SOMETHING_ELSE
    }

    @Mock
    public TweakrRepo repo;

    private TweakrRegistry registry;

    @Before
    public void setup() {
        MockitoAnnotations.initMocks(this);
        registry = new TweakrRegistry(repo);
    }

    @Test
// Path: android/tweakr/src/main/java/com/google/tweakr/types/DefaultValueTypeConverter.java
// public class DefaultValueTypeConverter implements ValueTypeConverter {
// 
//     @Override
//     public ValueType getType(Class<?> fieldType) {
//         if (fieldType.isArray()) {
//             return new ArrayValueType(getType(fieldType.getComponentType()));
//         }
// 
//         if (fieldType == float.class || fieldType == double.class || fieldType == Float.class || fieldType == Double.class) {
//             return new PrimitiveValueType(PrimitiveValueType.TYPE_FLOAT);
//         } else if (fieldType == int.class || fieldType == long.class || fieldType == Integer.class || fieldType == Long.class) {
//             return new PrimitiveValueType(PrimitiveValueType.TYPE_INT);
//         } else if (fieldType == boolean.class || fieldType == Boolean.class) {
//             return new PrimitiveValueType(PrimitiveValueType.TYPE_BOOLEAN);
//         } else if (fieldType.isAssignableFrom(String.class)) {
//             return new PrimitiveValueType(PrimitiveValueType.TYPE_STRING);
//         } else if (fieldType.isEnum()) {
//             return new EnumValueType(fieldType);
//         }
// 
//         return new PrimitiveValueType(PrimitiveValueType.TYPE_UNKNOWN);
//     }
// }
// 
// Path: android/tweakr/src/main/java/com/google/tweakr/types/ValueType.java
// public interface ValueType {
//     /**
//      * Simple name of the type. Used to select an appropriate UI.
//      */
//     String getName();
// 
//     /**
//      * A default value if one cannot be determined.
//      */
//     Object getDefault();
// 
//     /**
//      * Safely convert a value from Firebase into the correct type.
//      */
//     Object convert(Object newValue);
// 
//     /**
//      * For enum fields or other fields you want to restrict to only certain choices.
//      *
//      * @return An array of String representations of all possible values to choose from.
//      */
//     default List<String> getPossibleValues() {
//         return null;
//     }
// }
// 
// Path: android/tweakr/src/main/java/com/google/tweakr/types/VoidValueType.java
// public class VoidValueType implements ValueType {
// 
//     @Override
//     public String getName() {
//         return "void";
//     }
// 
//     @Override
//     public Object getDefault() {
//         return null;
//     }
// 
//     @Override
//     public Object convert(Object newValue) {
//         return null;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
//         ValueType that = (ValueType) o;
//         return getName().equals(that.getName());
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(getName());
//     }
// }


// Path: android/tweakr/src/test/java/com/google/tweakr/TweakrRegistryTest.java
import static org.mockito.Mockito.verify;
import com.google.tweakr.annotations.Tweak;
import com.google.tweakr.types.DefaultValueTypeConverter;
import com.google.tweakr.types.ValueType;
import com.google.tweakr.types.VoidValueType;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.isNull;

// Copyright 2019 Google LLC
//
// 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 com.google.tweakr;




/**
 * Example local unit test, which will execute on the development machine (host).
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
public class TweakrRegistryTest {

    private static final String TEST_STRING = "this is a test";
    private static final int TEST_INT = 134426;
    private static final Float TEST_FLOAT = 434.324f;

    private enum TestEnum {
        SOMETHING,
        SOMETHING_ELSE
    }

    @Mock
    public TweakrRepo repo;

    private TweakrRegistry registry;

    @Before
    public void setup() {
        MockitoAnnotations.initMocks(this);
        registry = new TweakrRegistry(repo);
    }

    @Test
    public void tweakString() {