FileSize implements Comparable<FileSize> { @Override public String toString() { return convertToStringRepresentation(bytes); } FileSize(String string);  FileSize(long bytes); long getBytes(); void setBytes(long bytes); @Override String toString(); long getMultiplier(char multiplierChar); static String convertToStringRepresentation(final long value); @Override int compareTo(FileSize o); @Override boolean equals(Object o); @Override int hashCode();  }
@Test (dataProvider = "testToStringDataProvider") public void testToString(long size, String expectedResult) throws Exception { FileSize fileSize = new FileSize(size); Assert.assertEquals(fileSize.toString(), expectedResult); }