private static SampleTypeModel createAllTypesModel(List<SampleType> basicTypes) {
    final SampleType allSampleType = new SampleType();
    allSampleType.setCode(EntityType.ALL_TYPES_CODE);
    allSampleType.setListable(true);

    Set<SampleTypePropertyType> allPropertyTypes = new HashSet<SampleTypePropertyType>();
    for (SampleType basicType : basicTypes) {
      allPropertyTypes.addAll(basicType.getAssignedPropertyTypes());
      setDatabaseInstance(allSampleType, basicType.getDatabaseInstance());
    }

    allSampleType.setSampleTypePropertyTypes(
        new ArrayList<SampleTypePropertyType>(allPropertyTypes));

    return new SampleTypeModel(allSampleType);
  }
 private static SampleTypeModel createTypeInFileModel() {
   final SampleType typeInFile = new SampleType();
   typeInFile.setCode(SampleType.DEFINED_IN_FILE);
   typeInFile.setListable(false);
   return new SampleTypeModel(typeInFile);
 }