### Question:
NormalizedFieldAndValue extends BaseNormalizedContent implements GroupedNormalizedContentInterface { public static String decode(byte[] bytes, boolean expectBinary) { synchronized (NormalizedFieldAndValue.class) { if (null == mimeDecoder) { IngestConfiguration config = IngestConfigurationFactory.getIngestConfiguration(); mimeDecoder = config.createMimeDecoder(); } } String value = null; if (!expectBinary) { try { value = Text.decode(mimeDecoder.decode(bytes)); } catch (Exception e) { } } if (value == null) { try { value = new String(bytes, "ISO8859-1"); } catch (UnsupportedEncodingException uee) { throw new RuntimeException(uee); } } return value; } NormalizedFieldAndValue();  NormalizedFieldAndValue(String field, byte[] value);  NormalizedFieldAndValue(String field, byte[] value, boolean expectBinary);  NormalizedFieldAndValue(String field, String value);  NormalizedFieldAndValue(String field, String value, Map<String,String> markings);  NormalizedFieldAndValue(String field, String value, String group, String subGroup);  NormalizedFieldAndValue(NormalizedContentInterface n); static String decode(byte[] bytes, boolean expectBinary); boolean isGrouped(); void setGrouped(boolean grouped); String getSubGroup(); void setSubGroup(String group); String getGroup(); void setGroup(String group); void setIndexedFieldName(String name); @Override void setFieldName(String name); void setEventFieldName(String name); String getEventFieldName(); int hashCode(); boolean equals(Object o); String toString();  }### Answer:
@Test public void testDecode() { String testValue = "Hello, World"; String results = NormalizedFieldAndValue.decode(testValue.getBytes(), false); Assert.assertEquals("Decode failed to correctly decode test value", testValue, results); results = NormalizedFieldAndValue.decode(testValue.getBytes(), true); Assert.assertEquals("Decode failed to correctly decode test value", testValue, results); String expected = "a"; byte[] binary = new byte[] {(byte) 0x61}; results = NormalizedFieldAndValue.decode(binary, false); Assert.assertEquals("Decode failed to correctly decode binary test", expected, results); results = NormalizedFieldAndValue.decode(binary, true); Assert.assertEquals("Decode failed to correctly decode binary test", expected, results); }