test_class.declarator: defaultValueGenerator
test_class.modifier: @Inject
test_class.original_string: @Inject
      DefaultValueGenerator defaultValueGenerator;
test_class.type: DefaultValueGenerator
test_class.var_name: defaultValueGenerator
test_class.file: gae-studio/gae-studio-server/src/test/java/com/arcbees/gaestudio/server/util/DefaultValueGeneratorTest.java
test_class.identifier: DefaultValueGeneratorTest
test_case.body: @Test
      public void givenDoubleValue_generateDefault_shouldReturn0() {
          // given
          Double doubleValue = 3d;
          double primitiveDouble = 4;
  
          // when
          Object result = defaultValueGenerator.generate(doubleValue);
          Object primitiveResult = defaultValueGenerator.generate(primitiveDouble);
  
          // then
          assertEquals(0d, result);
          assertEquals(0d, primitiveResult);
      }
test_case.class_method_signature: DefaultValueGeneratorTest.givenDoubleValue_generateDefault_shouldReturn0()
test_case.full_signature: @Test public void givenDoubleValue_generateDefault_shouldReturn0()
test_case.identifier: givenDoubleValue_generateDefault_shouldReturn0
test_case.invocations: generate generate assertEquals assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void givenDoubleValue_generateDefault_shouldReturn0()
focal_class.file: gae-studio/gae-studio-server/src/main/java/com/arcbees/gaestudio/server/util/DefaultValueGenerator.java
focal_class.identifier: DefaultValueGenerator
focal_class.class_method_signature: DefaultValueGenerator.generate(Object value)
focal_class.full_signature: public Object generate(Object value)
focal_class.identifier: generate
focal_class.modifiers: public
focal_class.parameters: (Object value)
focal_class.return: Object
focal_class.signature: Object generate(Object value)
focal_method.body: public Object generate(Object value) {
          if (value != null) {
              Class<?> clazz = value.getClass();
  
              if (clazz.isPrimitive()) {
                  return Defaults.defaultValue(clazz);
              } else {
                  Object defaultValue = BoxedDefaults.defaultValue(clazz);
                  if (defaultValue == null) {
                      try {
                          defaultValue = clazz.newInstance();
                      } catch (InstantiationException e) {
                          return null;
                      } catch (IllegalAccessException e) {
                          return null;
                      }
                  }
  
                  return defaultValue;
              }
          }
  
          return null;
      }
focal_method.class_method_signature: DefaultValueGenerator.generate(Object value)
focal_method.full_signature: public Object generate(Object value)
focal_method.identifier: generate
focal_method.invocations: getClass isPrimitive defaultValue defaultValue newInstance
focal_method.modifiers: public
focal_method.parameters: (Object value)
focal_method.return: Object
focal_method.signature: Object generate(Object value)