CowFace { protected static CowFace getByMode(final String mode) { if (mode != null) { return COW_MODES.get(mode); } return null; } CowFace(); private  CowFace(final String eyes); private  CowFace(final String eyes, final String tongue); String getEyes(); String getTongue(); final void setEyes(final String eyes); final void setTongue(final String tongue); static final boolean isKnownMode(final String mode);  }
@Test public void testGetByMode() { Set<String> modes = CowsayTest.modeMap.keySet(); for (String key : modes) { System.out.println("testGetByMode " + key); CowFace result = CowFace.getByMode(key); Assert.assertNotNull(result); } }
@Test public void testGetByModeWithNull() { CowFace result = CowFace.getByMode(null); Assert.assertNull(result); }