SymbolicLookup implements Function<Symbolic, String> { public static <T extends Symbolic> T resolve(String symbol, ImmutableMap<String, T> map, Class<T> clss) { T symbolic = map.get(symbol); if (symbolic == null) { throw new IllegalArgumentException(symbol + " is not a valid " + clss.getSimpleName() + " symbol"); } return symbolic; }  String apply(Symbolic symbolic); static ImmutableMap<String,T> map(T[] values); static T resolve(String symbol,
            ImmutableMap<String, T> map, Class<T> clss);  }
@Test public void resolve() { for (TestSymbol t : TestSymbol.values()) { assertEquals(t, SymbolicLookup.resolve(t.symbol(), map, TestSymbol.class)); } }
@Test(expected = IllegalArgumentException.class) public void resolve_IllegalArgumentException() { SymbolicLookup.resolve("f", map, TestSymbol.class); }