MetricCreator { public static Metric create(String data) { String [] values = data.split(SEPARATOR); return new Metric( values[0], Double.valueOf(values[1]), Integer.valueOf(values[2]) ); }  static Metric create(String data);  }
@Test public void shouldCreateMetric() { String data = "hermes.producer.c52940.meter.m1_rate 0.17 1412233849"; Metric metric = MetricCreator.create(data); assertThat(metric.getName()).isEqualTo("hermes.producer.c52940.meter.m1_rate"); assertThat(metric.getValue()).isEqualTo(0.17); assertThat(metric.getTimestamp()).isEqualTo(1412233849); }