@Test public void loadExactMatch2() throws Exception { List<String> lines = new NonBreakPointsLoaderImpl().loadNBSP("en_GB"); assertEquals(2, lines.size()); assertEquals("enGBRule1", lines.get(0)); assertEquals("enGBRule2", lines.get(1)); }
@Override public List<String> loadNBSP(String lang) { if (lang == null || lang.isEmpty()) { throw new IllegalArgumentException("Lang must be filled to search for file!"); } List<String> result = loadForKey(lang); if (result == null) { int index = lang.indexOf('_'); if (index < 0) return null; result = loadForKey(lang.substring(0, index)); } return result; }
NonBreakPointsLoaderImpl implements NonBreakPointsLoader { @Override public List<String> loadNBSP(String lang) { if (lang == null || lang.isEmpty()) { throw new IllegalArgumentException("Lang must be filled to search for file!"); } List<String> result = loadForKey(lang); if (result == null) { int index = lang.indexOf('_'); if (index < 0) return null; result = loadForKey(lang.substring(0, index)); } return result; } }
NonBreakPointsLoaderImpl implements NonBreakPointsLoader { @Override public List<String> loadNBSP(String lang) { if (lang == null || lang.isEmpty()) { throw new IllegalArgumentException("Lang must be filled to search for file!"); } List<String> result = loadForKey(lang); if (result == null) { int index = lang.indexOf('_'); if (index < 0) return null; result = loadForKey(lang.substring(0, index)); } return result; }  }
NonBreakPointsLoaderImpl implements NonBreakPointsLoader { @Override public List<String> loadNBSP(String lang) { if (lang == null || lang.isEmpty()) { throw new IllegalArgumentException("Lang must be filled to search for file!"); } List<String> result = loadForKey(lang); if (result == null) { int index = lang.indexOf('_'); if (index < 0) return null; result = loadForKey(lang.substring(0, index)); } return result; }  @Override List<String> loadNBSP(String lang); }
NonBreakPointsLoaderImpl implements NonBreakPointsLoader { @Override public List<String> loadNBSP(String lang) { if (lang == null || lang.isEmpty()) { throw new IllegalArgumentException("Lang must be filled to search for file!"); } List<String> result = loadForKey(lang); if (result == null) { int index = lang.indexOf('_'); if (index < 0) return null; result = loadForKey(lang.substring(0, index)); } return result; }  @Override List<String> loadNBSP(String lang);  }