### Question:
ArtworkFile { public String toString(byte[] libraryPersistentId) { StringBuilder sb = new StringBuilder(); sb.append(dir.name()); sb.append('/'); String libDir = Util.pidToString(libraryPersistentId); sb.append(libDir); sb.append('/'); sb.append(String.format("%02d", id[7] & 0x0F)); sb.append('/'); sb.append(String.format("%02d", (id[7] >> 4) & 0x0F)); sb.append('/'); sb.append(String.format("%02d", id[6] & 0x0F)); sb.append('/' + libDir + "-" + Util.pidToString(id)); sb.append(".itc"); if (version != 1) { sb.append(version); } return sb.toString(); } ArtworkFile(Directory dir, byte[] id, int version); File getFile(File artworkDirectory, byte[] libraryPersistentId); String toString(byte[] libraryPersistentId);  }### Answer:
@Test public void fileFromDefinition() { ArtworkFile af = new ArtworkFile( ArtworkFile.Directory.Cache, new byte[8], 2); String f = af.toString(new byte[8]); assertEquals( "Cache/0000000000000000/00/00/00/0000000000000000-0000000000000000.itc2", f); }
@Test public void fileFromDefinitionWithNumbers() { ArtworkFile af = new ArtworkFile( ArtworkFile.Directory.Cache, new byte[]{0, 1, 2, 3, 4, 5, 6, 7}, 1); String f = af.toString( new byte[]{8, 9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF}); assertEquals( "Cache/08090A0B0C0D0E0F/07/00/06/08090A0B0C0D0E0F-0001020304050607.itc", f); }