DrumkitMeta { public static DrumkitMeta fromJson(String jsonString) { return new GsonBuilder() .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) .create() .fromJson(jsonString, DrumkitMeta.class); } private  DrumkitMeta();  DrumkitMeta(DrumkitMeta meta); int getDrumVersion(); String getType(); String getName(); int getOctave(); int[] getPitch(); int[] getStart(); int[] getEnd(); int[] getPlaymode(); int[] getReverse(); int[] getVolume(); int[] getDynaEnv(); boolean isFxActive(); String getFxType(); int[] getFxParams(); boolean isLfoActive(); String getLfoType(); int[] getLfoParams(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static DrumkitMeta fromJson(String jsonString); static DrumkitMeta fromApplicationChunk(ApplicationChunk chunk); static String toJson(DrumkitMeta drumkitMeta); static String toJsonPrettyPrint(DrumkitMeta drumkitMeta); static DrumkitMeta newDefaultDrumkitMeta(String name); static DrumkitMeta.Builder newDefaultDrumkitMetaBuilder(String name);  }
@Test public void canReadDrumkitMetaFromDrumkitFile() throws Exception { final InputStream inputStream = DrumkitMetaTest.class.getClassLoader().getResourceAsStream(DRUMKIT_FILE); final DataInputStream dataInputStream = new DataInputStream(inputStream); final IffReader iffReader = new IffReader(dataInputStream); final AiffReader aiffReader = new AiffReader(iffReader); final Aiff aiff = aiffReader.readAiff(); assertThat(aiff, notNullValue()); List<Chunk> chunks = aiff.getChunks(ChunkType.APPLICATION.getChunkId()); assertThat(chunks, Matchers.notNullValue()); assertThat(chunks.size(), equalTo(1)); ApplicationChunk chunk = (ApplicationChunk) chunks.get(0); String json = SignedChar.getString(chunk.getData()); DrumkitMeta meta = DrumkitMeta.fromJson(json); System.out.println(meta); System.out.println(aiff.getCommonChunk()); }