SessionTrafficResult { public Object[] toArray() { Object[] objects = new Object[5]; objects[0] = timestamp; objects[1] = inputBytes; objects[2] = outputBytes; objects[3] = inputRates; objects[4] = outputRates; return objects; } SessionTrafficResult(long timestamp, long inputBytes, long outputBytes, long inputRates, long outputRates); Object[] toArray(); static SessionTrafficResult parseFromArray(Object[] objects); long getTimestamp(); long getInputBytes(); long getOutputBytes(); long getInputRates(); long getOutputRates(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void toArray() { long timestamp = System.currentTimeMillis(); long input = 1000, output = 2000, inputRates = 10, outputRates = 20; result = new SessionTrafficResult(timestamp, input, output, inputRates, outputRates); Object[] objects = result.toArray(); Assert.assertEquals(timestamp, objects[0]); Assert.assertEquals(input, objects[1]); Assert.assertEquals(output, objects[2]); }