@Test
public void testFindFieldForPath() {

  final JBBPFieldByte field = new JBBPFieldByte(new JBBPNamedFieldInfo("struct1.struct2.field3", "field3", 2048), (byte) 78);
  final JBBPFieldStruct struct2 = new JBBPFieldStruct(new JBBPNamedFieldInfo("struct1.struct2", "struct2", 1024), new JBBPAbstractField[] {field});
  final JBBPFieldStruct struct1 = new JBBPFieldStruct(new JBBPNamedFieldInfo("struct1", "struct1", 1024), new JBBPAbstractField[] {struct2});
  try {
    struct1.findFieldForPath(null);
    fail("Must throw NPE");
  } catch (NullPointerException ex) {
  }
  try {
    struct1.findFieldForPath("struct1.struct2.field3.unknown");
    fail("Must throw finder exception for attempt to find inside a field");
  } catch (JBBPFinderException ex) {
  }
  assertNull(struct1.findFieldForPath("struct1.struct2.field0"));
  assertNull(struct1.findFieldForPath("struct"));
  assertSame(field, struct1.findFieldForPath("struct1.struct2.field3"));
}