@Test public void collection_without_projects() throws JsonProcessingException { Project project = Project.of(new NameDescription("PRJ", "Project")); List<Branch> branches = Arrays.asList( Branch.of(project, new NameDescription("B1", "Branch 1")).withSignature(SIGNATURE), Branch.of(project, new NameDescription("B2", "Branch 2")).withSignature(SIGNATURE) ); assertJsonWrite( array() .with(object() .with("id", 0) .with("name", "B1") .with("description", "Branch 1") .with("disabled", false) .with("type", "CLASSIC") .with("signature", SIGNATURE_OBJECT) .end()) .with(object() .with("id", 0) .with("name", "B2") .with("description", "Branch 2") .with("disabled", false) .with("type", "CLASSIC") .with("signature", SIGNATURE_OBJECT) .end()) .end(), branches, List.class ); }
public static Branch of(Project project, NameDescription nameDescription) { return of(project, nameDescription.asState()); }
Branch implements ProjectEntity { public static Branch of(Project project, NameDescription nameDescription) { return of(project, nameDescription.asState()); } }
Branch implements ProjectEntity { public static Branch of(Project project, NameDescription nameDescription) { return of(project, nameDescription.asState()); }  }
Branch implements ProjectEntity { public static Branch of(Project project, NameDescription nameDescription) { return of(project, nameDescription.asState()); }  static Branch of(Project project, NameDescription nameDescription); static Branch of(Project project, NameDescriptionState nameDescription); @Override ProjectEntityType getProjectEntityType(); @Override String getEntityDisplayName(); Branch withId(ID id); static Form form(); Form toForm(); Branch update(NameDescriptionState form); }
Branch implements ProjectEntity { public static Branch of(Project project, NameDescription nameDescription) { return of(project, nameDescription.asState()); }  static Branch of(Project project, NameDescription nameDescription); static Branch of(Project project, NameDescriptionState nameDescription); @Override ProjectEntityType getProjectEntityType(); @Override String getEntityDisplayName(); Branch withId(ID id); static Form form(); Form toForm(); Branch update(NameDescriptionState form);  }