### Question:
AnnotationEdmProvider extends EdmProvider { @Override public ComplexType getComplexType(final FullQualifiedName edmFQName) throws ODataException { Schema schema = namespace2Schema.get(edmFQName.getNamespace()); if (schema != null) { List<ComplexType> complexTypes = schema.getComplexTypes(); for (ComplexType complexType : complexTypes) { if (complexType.getName().equals(edmFQName.getName())) { return complexType; } } } return null; } AnnotationEdmProvider(final Collection<Class<?>> annotatedClasses);  AnnotationEdmProvider(final String packageToScan); @Override Association getAssociation(final FullQualifiedName edmFQName); @Override AssociationSet getAssociationSet(final String entityContainer, final FullQualifiedName association,
      final String sourceEntitySetName, final String sourceEntitySetRole); @Override ComplexType getComplexType(final FullQualifiedName edmFQName); @Override EntityContainerInfo getEntityContainerInfo(final String name); @Override EntitySet getEntitySet(final String entityContainer, final String name); @Override EntityType getEntityType(final FullQualifiedName edmFQName); @Override FunctionImport getFunctionImport(final String entityContainer, final String name); @Override List<Schema> getSchemas();  }### Answer:
@Test public void defaultNamespaceGenerationComplexType() throws ODataException { Collection<Class<?>> localAnnotatedClasses = new ArrayList<Class<?>>(); localAnnotatedClasses.add(GeneratedNamesComplexTestClass.class); AnnotationEdmProvider localAep = new AnnotationEdmProvider(localAnnotatedClasses); ComplexType testType = localAep.getComplexType(new FullQualifiedName( GeneratedNamesComplexTestClass.class.getPackage().getName(), GeneratedNamesComplexTestClass.class.getSimpleName())); assertNotNull("Requested entity not found.", testType); assertEquals("GeneratedNamesComplexTestClass", testType.getName()); assertNull("This should not have a base type", testType.getBaseType()); }
@Test public void defaultNamespaceGenerationComplexType() throws ODataException { Collection<Class<?>> localAnnotatedClasses = new ArrayList<>(); localAnnotatedClasses.add(GeneratedNamesComplexTestClass.class); AnnotationEdmProvider localAep = new AnnotationEdmProvider(localAnnotatedClasses); ComplexType testType = localAep.getComplexType(new FullQualifiedName( GeneratedNamesComplexTestClass.class.getPackage().getName(), GeneratedNamesComplexTestClass.class.getSimpleName())); assertNotNull("Requested entity not found.", testType); assertEquals("GeneratedNamesComplexTestClass", testType.getName()); assertNull("This should not have a base type", testType.getBaseType()); }
@Test public void defaultFieldsWoAnnotationsToPropertiesForComplexTypes() throws ODataException { @SuppressWarnings({ "unchecked", "rawtypes" }) AnnotationEdmProvider localAep = new AnnotationEdmProvider(Collections.singletonList(TestComplexWithoutAnnotation.class)); String defaultNs = TestComplexWithoutAnnotation.class.getPackage().getName(); FullQualifiedName fqn = new FullQualifiedName(defaultNs, TestComplexWithoutAnnotation.class.getSimpleName()); ComplexType entityType = localAep.getComplexType(fqn); assertNotNull(entityType); assertEquals("TestComplexWithoutAnnotation", entityType.getName()); List<Property> properties = entityType.getProperties(); assertEquals(3, properties.size()); assertTrue(contains("Id", properties)); assertTrue(contains("SomeValue", properties)); assertTrue(contains("AnotherValue", properties)); }