@Override
    public Metrics toDay() {
        MaxLabeledFunction metrics = (MaxLabeledFunction) createNew();
        metrics.setEntityId(getEntityId());
        metrics.setTimeBucket(toTimeBucketInDay());
        metrics.setServiceId(getServiceId());
        metrics.getValue().copyFrom(getValue());
        return metrics;
    }
@Test
    public void testToDay() {
        function.accept(
                MeterEntity.newService("service-test", Layer.GENERAL),
                HTTP_CODE_COUNT_1
        );
        function.accept(
                MeterEntity.newService("service-test", Layer.GENERAL),
                HTTP_CODE_COUNT_2
        );
        function.calculate();

        final MaxLabeledFunction dayFunction = (MaxLabeledFunction) function.toDay();
        dayFunction.calculate();

        assertThat(dayFunction.getValue()).isEqualTo(HTTP_CODE_COUNT_3);
    }