@Test public void testNiceExceptionOnNotFound() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage( "ResourceTypes do not include RRRR; types: " + Arrays.asList(ResourceTypes.values())); ResourceTypeToValue.lookup("RRRR"); }
public static Integer lookup(String type) throws IllegalArgumentException { checkNotNull(type, "resource type was null"); checkArgument(lookup.containsKey(type), "%s do not include %s; types: %s", ResourceTypes.class.getSimpleName(), type, EnumSet.allOf(ResourceTypes.class)); return lookup.get(type); }
ResourceTypeToValue { public static Integer lookup(String type) throws IllegalArgumentException { checkNotNull(type, "resource type was null"); checkArgument(lookup.containsKey(type), "%s do not include %s; types: %s", ResourceTypes.class.getSimpleName(), type, EnumSet.allOf(ResourceTypes.class)); return lookup.get(type); } }
ResourceTypeToValue { public static Integer lookup(String type) throws IllegalArgumentException { checkNotNull(type, "resource type was null"); checkArgument(lookup.containsKey(type), "%s do not include %s; types: %s", ResourceTypes.class.getSimpleName(), type, EnumSet.allOf(ResourceTypes.class)); return lookup.get(type); }  }
ResourceTypeToValue { public static Integer lookup(String type) throws IllegalArgumentException { checkNotNull(type, "resource type was null"); checkArgument(lookup.containsKey(type), "%s do not include %s; types: %s", ResourceTypes.class.getSimpleName(), type, EnumSet.allOf(ResourceTypes.class)); return lookup.get(type); }  static Integer lookup(String type); static String lookup(Integer type); }
ResourceTypeToValue { public static Integer lookup(String type) throws IllegalArgumentException { checkNotNull(type, "resource type was null"); checkArgument(lookup.containsKey(type), "%s do not include %s; types: %s", ResourceTypes.class.getSimpleName(), type, EnumSet.allOf(ResourceTypes.class)); return lookup.get(type); }  static Integer lookup(String type); static String lookup(Integer type);  }