### Question:
FieldFactory { public static <F extends AbstractField<?>> F fromStringValue(int tagNum, String value) { FieldType fieldType = FieldType.forTag(tagNum); return fromStringValue(fieldType.type(), tagNum, value); }  static F valueOf(int tagNum, byte[] value); @SuppressWarnings("unchecked") static F valueOf(int tagNum, byte[] value, int offset, int length); @SuppressWarnings("unchecked") static F fromIntValue(DataType type, int tagNum, int value); static F fromIntValue(int tagNum, int value); static F fromLongValue(int tagNum, long value); static F fromLongValue(FieldType fieldType, long value); @SuppressWarnings("unchecked") static F fromLongValue(DataType type, int tagNum, long value); static F fromStringValue(int tagNum, String value); static F fromStringValue(FieldType fieldType, String value); @SuppressWarnings("unchecked") static F fromStringValue(DataType type, int tagNum, String value); static F fromFixedPointValue(int tagNum, FixedPointNumber value); static F fromFixedPointValue(FieldType fieldType, FixedPointNumber value); @SuppressWarnings("unchecked") static F fromFixedPointValue(DataType type, int tagNum, FixedPointNumber value);  }### Answer:
@Test @Parameters({"200303", "20030320", "200303w2"}) public void testFromStringValueMonthYear(final String value) { final int tag = FieldType.MaturityMonthYear.tag(); StringField field = FieldFactory.fromStringValue(DataType.MONTHYEAR, tag, value); assertEquals("tagnum", tag, field.getTagNum()); assertEquals("value", value, field.getValue()); }
@Test @Parameters({"2003-09-10"}) public void testFromStringValueLocalMktDate(final String value) { final int tag = FieldType.TradeOriginationDate.tag(); StringField field = FieldFactory.fromStringValue(DataType.LOCALMKTDATE, tag, value); assertEquals("tagnum", tag, field.getTagNum()); assertEquals("value", value, field.getValue()); }
@Test @Parameters({"Y", "true", "TRUE"}) public void testFromStringValueBooleanTrue(final String value) { final int tag = FieldType.PossDupFlag.tag(); BooleanField field = FieldFactory.fromStringValue(DataType.BOOLEAN, tag, value); assertEquals("tagnum", tag, field.getTagNum()); assertSame("value", Boolean.TRUE, field.getValue()); assertTrue("value", field.booleanValue()); }
@Test @Parameters({"N", "false", "FALSE"}) public void testValueStringValueBooleanFalse(final String value) { final int tag = FieldType.PossDupFlag.tag(); BooleanField field = FieldFactory.fromStringValue(DataType.BOOLEAN, tag, value); assertEquals("tagnum", tag, field.getTagNum()); assertSame("value", Boolean.FALSE, field.getValue()); assertFalse("value", field.booleanValue()); }