// Path: src/main/java/org/laborra/beantrace/VertexFieldAdder.java
// public interface VertexFieldAdder {
//     void addField(Vertex vertex, String fieldName, Object item);
// }
// 
// Path: src/main/java/org/laborra/beantrace/model/Vertex.java
// public class Vertex {
//     private Class<?> clazz;
//     private String id;
//     private Set<Edge> references = new HashSet<>();
//     private Set<Attribute> attributes = new HashSet<>();
// 
//     public Vertex(Class<?> clazz, String id) {
//         this(clazz, id, new HashSet<Edge>(), new HashSet<Attribute>());
//     }
// 
//     public Vertex(Class<?> clazz, String id, Set<Edge> references, Set<Attribute> attributes) {
//         this.id = id;
//         this.clazz = clazz;
//         this.references = references;
//         this.attributes = attributes;
//     }
// 
//     public Set<Edge> getReferences() {
//         return references;
//     }
// 
//     public Set<Attribute> getAttributes() {
//         return attributes;
//     }
// 
//     public Class<?> getClazz() {
//         return clazz;
//     }
// 
//     public String getId() {
//         return id;
//     }
// }


import org.laborra.beantrace.VertexFieldAdder;
import org.laborra.beantrace.model.Vertex;
package org.laborra.beantrace.handlers;


abstract class TypeBasedHandler<T> implements VertexHandler {

    private final Class<?> handledType;

    protected TypeBasedHandler(Class<?> handledType) {
        this.handledType = handledType;
    }

    @Override
    public boolean canHandle(Object subject) {
        return handledType.isAssignableFrom(subject.getClass());
    }

    @Override
    @SuppressWarnings("unchecked")
// Path: src/main/java/org/laborra/beantrace/VertexFieldAdder.java
// public interface VertexFieldAdder {
//     void addField(Vertex vertex, String fieldName, Object item);
// }
// 
// Path: src/main/java/org/laborra/beantrace/model/Vertex.java
// public class Vertex {
//     private Class<?> clazz;
//     private String id;
//     private Set<Edge> references = new HashSet<>();
//     private Set<Attribute> attributes = new HashSet<>();
// 
//     public Vertex(Class<?> clazz, String id) {
//         this(clazz, id, new HashSet<Edge>(), new HashSet<Attribute>());
//     }
// 
//     public Vertex(Class<?> clazz, String id, Set<Edge> references, Set<Attribute> attributes) {
//         this.id = id;
//         this.clazz = clazz;
//         this.references = references;
//         this.attributes = attributes;
//     }
// 
//     public Set<Edge> getReferences() {
//         return references;
//     }
// 
//     public Set<Attribute> getAttributes() {
//         return attributes;
//     }
// 
//     public Class<?> getClazz() {
//         return clazz;
//     }
// 
//     public String getId() {
//         return id;
//     }
// }


// Path: src/main/java/org/laborra/beantrace/handlers/TypeBasedHandler.java
import org.laborra.beantrace.VertexFieldAdder;
import org.laborra.beantrace.model.Vertex;

package org.laborra.beantrace.handlers;


abstract class TypeBasedHandler<T> implements VertexHandler {

    private final Class<?> handledType;

    protected TypeBasedHandler(Class<?> handledType) {
        this.handledType = handledType;
    }

    @Override
    public boolean canHandle(Object subject) {
        return handledType.isAssignableFrom(subject.getClass());
    }

    @Override
    @SuppressWarnings("unchecked")
    public void handle(Vertex vertex, Object subject, VertexFieldAdder vertexFieldAdder) {