@Test(expected = IllegalStateException.class) public void should_throw_an_exception_because_language_is_not_supported() { GherkinDialectProvider.getDialect("blabla"); }
public static GherkinDialect getDialect(String language) { Map<String, List<String>> map = DIALECTS.get(language); if (map == null) { throw new IllegalStateException("Unsupported language: " + language); } return new GherkinDialect(language, map); }
GherkinDialectProvider { public static GherkinDialect getDialect(String language) { Map<String, List<String>> map = DIALECTS.get(language); if (map == null) { throw new IllegalStateException("Unsupported language: " + language); } return new GherkinDialect(language, map); } }
GherkinDialectProvider { public static GherkinDialect getDialect(String language) { Map<String, List<String>> map = DIALECTS.get(language); if (map == null) { throw new IllegalStateException("Unsupported language: " + language); } return new GherkinDialect(language, map); } private  GherkinDialectProvider(); }
GherkinDialectProvider { public static GherkinDialect getDialect(String language) { Map<String, List<String>> map = DIALECTS.get(language); if (map == null) { throw new IllegalStateException("Unsupported language: " + language); } return new GherkinDialect(language, map); } private  GherkinDialectProvider(); static GherkinDialect getDialect(String language); }
GherkinDialectProvider { public static GherkinDialect getDialect(String language) { Map<String, List<String>> map = DIALECTS.get(language); if (map == null) { throw new IllegalStateException("Unsupported language: " + language); } return new GherkinDialect(language, map); } private  GherkinDialectProvider(); static GherkinDialect getDialect(String language); static final Pattern LANGUAGE_DECLARATION_PATTERN; static final String DEFAULT_LANGUAGE; }