### Question:
MemoryMeasurer extends AbstractVisitor implements Resettable { private void measure(Object object){ boolean status = this.objects.add(object); if(!status){ return; } this.size += this.instrumentation.getObjectSize(object); Class<?> clazz = object.getClass(); if(ReflectionUtil.isPrimitiveWrapper(clazz)){ return; } List<Field> fields = ReflectionUtil.getFields(clazz); for(Field field : fields){ Class<?> type = field.getType(); if(type.isPrimitive()){ continue; } Object value = ReflectionUtil.getFieldValue(field, object); if(shouldMeasure(value)){ measure(value); } } if(object instanceof Object[]){ Object[] values = (Object[])object; for(int i = 0; i < values.length; i++){ Object value = values[i]; if(shouldMeasure(value)){ measure(value); } } } } MemoryMeasurer(); @Override void reset(); @Override VisitorAction visit(PMMLObject object); long getSize(); Set<Object> getObjects();  }### Answer:
@Test public void measure(){ Interval interval = new Interval(Interval.Closure.CLOSED_CLOSED) .setLeftMargin(0d) .setRightMargin(1d); DataField left = new DataField(FieldName.create("x"), null, null) .addIntervals(interval); DataField right = new DataField(FieldName.create("x"), OpType.CONTINUOUS, DataType.DOUBLE) .addIntervals(interval); assertEquals(getSize(left), getSize(right)); }