MetaExtractorImpl implements MetaExtractor { static int parseTrackNum(String track_num) throws NumberFormatException { if (StringUtils.contains(track_num, "/")) { return Integer.parseInt(StringUtils.split(track_num, "/")[0]); } else { return Integer.parseInt(track_num); } } @Inject  MetaExtractorImpl(@ForApplication Context appContext); @Override @Nullable Metadata extractMetadata(Track.Res res);  }
@Test public void testParseTrackNum() { int track = MetaExtractorImpl.parseTrackNum("3/10"); Assertions.assertThat(track).isEqualTo(3); track = MetaExtractorImpl.parseTrackNum("4"); Assertions.assertThat(track).isEqualTo(4); }