@Test
public void testFindFirstFieldForType() {

  final JBBPNamedNumericFieldMap map = new JBBPNamedNumericFieldMap();
  final JBBPNumericField field1 = new JBBPFieldInt(new JBBPNamedFieldInfo("test.test", "test", 0), 123);
  final JBBPNumericField field2 = new JBBPFieldInt(new JBBPNamedFieldInfo("test.test2", "test2", 0), 123);
  final JBBPNumericField field3 = new JBBPFieldByte(new JBBPNamedFieldInfo("test.test3", "test3", 0), (byte) 123);
  map.putField(field1);
  map.putField(field2);
  map.putField(field3);
  assertSame(field1, map.findFirstFieldForType(JBBPFieldInt.class));
  assertNull(map.findFirstFieldForType(JBBPFieldLong.class));
  try {
    map.findFirstFieldForType(null);
    fail("Must throw NPE");
  } catch (NullPointerException ex) {
  }
}