### Question:
RangeConverter { @Nullable public static Token resolveToken(TreeMetaDataProvider metaDataProvider, @Nullable String tokenReference) { TextRange range = parse(tokenReference); if (range == null) { return null; } return metaDataProvider.firstToken(range) .orElseThrow(() -> new NoSuchElementException("Token not found: " + tokenReference)); } private  RangeConverter(); @Nullable static String format(@Nullable TextRange range); @Nullable static TextRange parse(@Nullable String value); @Nullable static String tokenReference(@Nullable Token token); @Nullable static Token resolveToken(TreeMetaDataProvider metaDataProvider, @Nullable String tokenReference); static String metaDataReference(Tree tree); static TreeMetaData resolveMetaData(TreeMetaDataProvider metaDataProvider, String metaDataReference); @Nullable static String treeReference(@Nullable Tree tree); @Nullable static T resolveNullableTree(Tree parent, @Nullable String treeReference, Class<T> childClass);  }### Answer:
@Test public void resolve_token() { Token token = otherToken(1, 0, "foo"); Token actual = RangeConverter.resolveToken(metaDataProvider, "1:0:1:3"); assertThat(actual).isSameAs(token); assertThat(RangeConverter.resolveToken(metaDataProvider, null)).isNull(); }
@Test public void resolve_invalid_token() { exceptionRule.expect(NoSuchElementException.class); exceptionRule.expectMessage("Token not found: 2:0:2:3"); otherToken(1, 0, "foo"); RangeConverter.resolveToken(metaDataProvider, "2:0:2:3"); }