Build tree method works correctly. Added hashCode/equals to Field.