MapTypeDefinitionBuilder implements DeclaredTypeDefinitionBuilder { @Override public boolean accept(ProcessingEnvironment processingEnv, DeclaredType type) { Elements elements = processingEnv.getElementUtils(); TypeElement mapTypeElement = elements.getTypeElement(Map.class.getTypeName()); TypeMirror mapType = mapTypeElement.asType(); Types types = processingEnv.getTypeUtils(); TypeMirror erasedType = types.erasure(type); return types.isAssignable(erasedType, mapType); }  @Override boolean accept(ProcessingEnvironment processingEnv, DeclaredType type); @Override void build(ProcessingEnvironment processingEnv, DeclaredType type, TypeDefinition typeDefinition); @Override int getPriority();  }
@Test public void testAccept() { assertTrue(builder.accept(processingEnv, stringsField.asType())); assertTrue(builder.accept(processingEnv, colorsField.asType())); assertTrue(builder.accept(processingEnv, primitiveTypeModelsField.asType())); assertTrue(builder.accept(processingEnv, modelsField.asType())); assertTrue(builder.accept(processingEnv, modelArraysField.asType())); }