### Question:
DataUtil { public static void setValueString(DataType d, String value) throws DataException { if (value != null && value.length() > 255) { try { setValue(d, value.getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { logger.error(e.getMessage()); logger.error(FactoryException.TRACE_EXCEPTION,e); } d.setShortData(null); if(d.getMimeType() == null || d.getMimeType().length() == 0){ d.setMimeType("text/plain"); } } else { d.setShortData(value); } } private  DataUtil(); static void clearCipher(DataType data); static void setCipher(DataType data); static void setCipher(DataType data, SecurityBean bean); static void clearPassword(DataType data); static void setPassword(DataType data, String password); static void setValueString(DataType d, String value); static String getValueString(DataType d); static void setValue(DataType d, byte[] inValue); static byte[] getValue(DataType d); static boolean tryCompress(DataType d); static final Logger logger; }### Answer:
@Test public void testDataTypeSetShortData(){ logger.info("Setting short data"); DataType data = new DataType(); boolean error = false; try{ DataUtil.setValueString(data, "Example text"); } catch(DataException de){ error = true; } assertFalse("An error was encountered", error); assertTrue("Short data not set", data.getShortData() != null && data.getShortData().length() > 0); }