public static EntityInformation serializeEntity(InternalComponentManager componentManager, EntityRef clientEntity,
                                                    int entityId, EntityRef entity, Iterable<? extends EntityComponentFieldFilter> componentFieldFilters) {
        EntityInformation entityInformation = new EntityInformation();
        entityInformation.setEntityId(entityId);
        for (Class<? extends Component> componentClass : entity.listComponents()) {
            if (filtersAcceptComponent(clientEntity, entity, componentClass, componentFieldFilters)) {
                Component component = entity.getComponent(componentClass);

                ComponentInformation componentInformation = new ComponentInformation(componentClass);

                Map<String, Class<?>> fieldTypes = componentManager.getComponentFieldTypes(component);
                for (Map.Entry<String, Class<?>> fieldTypeEntry : fieldTypes.entrySet()) {
                    String fieldName = fieldTypeEntry.getKey();
                    if (filtersAcceptField(clientEntity, entity, componentClass, fieldName, componentFieldFilters)) {
                        componentInformation.addField(fieldName, componentManager.getComponentFieldValue(component, fieldName, fieldTypeEntry.getValue()));
                    }
                }
                entityInformation.addComponent(componentInformation);
            }
        }
        return entityInformation;
    }