BiBer1992 extends OkHttpBaseApi { public static String[] findTitleAndAuthor(String value) { Matcher m = PATTERN_TITLE_AUTHOR.matcher(value); if (m.matches()) { return new String[]{m.group(2) != null ? m.group(2).trim() : null, m.group(1) != null ? m.group(1).trim() : null}; } else { return new String[]{null, null}; } }  @Override List<SearchField> parseSearchFields(); @Override void init(Library lib, HttpClientFactory httpClientFactory); @Override SearchRequestResult search(List<SearchQuery> queryList); @Override SearchRequestResult searchGetPage(int page); @Override DetailedItem getResultById(String id, String homebranch); @Override DetailedItem getResult(int position); @Override ReservationResult reservation(DetailedItem item, Account account,
            int useraction, String selection); @Override ProlongResult prolong(String media, Account account, int useraction,
            String Selection); @Override CancelResult cancel(String media, Account account, int useraction,
            String selection); @Override AccountData account(Account account); static String[] findTitleAndAuthor(String value); @Override String getShareUrl(String id, String title); @Override int getSupportFlags(); @Override ProlongAllResult prolongAll(Account account, int useraction,
            String selection); @Override SearchRequestResult filterResults(Filter filter, Option option); @Override void checkAccountData(Account account); @Override void setLanguage(String language); @Override Set<String> getSupportedLanguages();  }
@Test public void testParseTitles() { assert Arrays.equals(BiBer1992.findTitleAndAuthor("Signature / Author: Bar"), new String[]{"Bar", "Author"}); assert Arrays.equals(BiBer1992.findTitleAndAuthor("Signature / Author:"), new String[]{"", "Author"}); assert Arrays .equals(BiBer1992.findTitleAndAuthor("Signature / Bar"), new String[]{"Bar", null}); assert Arrays.equals(BiBer1992.findTitleAndAuthor("Signature / "), new String[]{"", null}); assert Arrays.equals(BiBer1992.findTitleAndAuthor("Bar"), new String[]{"Bar", null}); assert Arrays .equals(BiBer1992.findTitleAndAuthor("Author: Bar"), new String[]{"Bar", "Author"}); assert Arrays.equals(BiBer1992.findTitleAndAuthor("Android Welt 3/15 Mai-Juni"), new String[]{"Android Welt 3/15 Mai-Juni", null}); assert Arrays.equals(BiBer1992.findTitleAndAuthor("Test / /English /for /runaways"), new String[]{"/English /for /runaways", null}); assert Arrays.equals(BiBer1992.findTitleAndAuthor("Test / /Andersen, /Lale: /Mein /Leben"), new String[]{"/Mein /Leben", "/Andersen, /Lale"}); assert Arrays.equals(BiBer1992.findTitleAndAuthor("Buch/Jonasson, Jonas: Die / Springe"), new String[]{"Die / Springe", "Jonasson, Jonas"}); assert Arrays.equals(BiBer1992.findTitleAndAuthor("Buch/Deutschland - Osten / Springe"), new String[]{"Deutschland - Osten / Springe", null}); }