@Test public void testToString() { dc = new DCLanguage(null); assertThat("testToString 0", dc.toString(), equalTo("")); dc = new DCLanguage(""); assertThat("testToString 1", dc.toString(), equalTo("")); dc = new DCLanguage("other"); assertThat("testToString 2", dc.toString(), equalTo("other")); dc = new DCLanguage("12"); assertThat("testToString 3", dc.toString(), equalTo("12")); dc = new DCLanguage("12345"); assertThat("testToString 4", dc.toString(), equalTo("45_12")); dc = new DCLanguage("123456"); assertThat("testToString 5", dc.toString(), equalTo("")); dc = new DCLanguage("1234567890"); assertThat("testToString 6", dc.toString(), equalTo("")); }
public String toString() { if (language.equals("")) { return ""; } else if (country.equals("")) { return language; } else { return country + "_" + language; } }
DCLanguage { public String toString() { if (language.equals("")) { return ""; } else if (country.equals("")) { return language; } else { return country + "_" + language; } } }
DCLanguage { public String toString() { if (language.equals("")) { return ""; } else if (country.equals("")) { return language; } else { return country + "_" + language; } } DCLanguage(String l); }
DCLanguage { public String toString() { if (language.equals("")) { return ""; } else if (country.equals("")) { return language; } else { return country + "_" + language; } } DCLanguage(String l); String toString(); final void setLanguage(String l); String getDisplayName(); }
DCLanguage { public String toString() { if (language.equals("")) { return ""; } else if (country.equals("")) { return language; } else { return country + "_" + language; } } DCLanguage(String l); String toString(); final void setLanguage(String l); String getDisplayName();  }