MetaExtractorImpl implements MetaExtractor { static int parseDiskNum(String disc_num) throws NumberFormatException { if (StringUtils.contains(disc_num, "/")) { return Integer.parseInt(StringUtils.split(disc_num, "/")[0]); } else { return Integer.parseInt(disc_num); } } @Inject  MetaExtractorImpl(@ForApplication Context appContext); @Override @Nullable Metadata extractMetadata(Track.Res res);  }
@Test public void testParseDiscNum() { int disc = MetaExtractorImpl.parseDiskNum("1/1"); Assertions.assertThat(disc).isEqualTo(1); disc = MetaExtractorImpl.parseDiskNum("2"); Assertions.assertThat(disc).isEqualTo(2); }