PoolImpl extends AbstractBoxable implements Pool { @Override public String getLongestIndex() { return LimsUtils.getLongestIndex(poolElements.stream() .flatMap(element -> element.getPoolableElementView().getIndices().stream())); } PoolImpl(); @Override Boxable.EntityType getEntityType(); @Override void addNote(Note note); @Override int compareTo(Pool t); @Override boolean equals(Object obj); @Override int hashCode(); @Override boolean isMergeChild(); @Override void makeMergeChild(); @Override Box getBox(); @Override String getBoxPosition(); @Override void setBoxPosition(PoolBoxPosition boxPosition); @Override void removeFromBox(); @Override Collection<ChangeLog> getChangeLog(); @Override BigDecimal getConcentration(); @Override Date getCreationDate(); @Override String getDescription(); @Override boolean getHasLowQualityMembers(); @Override long getId(); @Override String getIdentificationBarcode(); @Override String getLabelText(); @Override String getLocationBarcode(); @Override String getName(); @Override String getAlias(); @Override Collection<Note> getNotes(); @Override PlatformType getPlatformType(); @Override Collection<PoolQC> getQCs(); @Override Boolean getQcPassed(); @Override List<FileAttachment> getAttachments(); @Override void setAttachments(List<FileAttachment> attachments); @Override String getAttachmentsTarget(); @Override List<FileAttachment> getPendingAttachmentDeletions(); @Override void setPendingAttachmentDeletions(List<FileAttachment> pendingAttachmentDeletions); @Override boolean hasLibrariesWithoutIndex(); @Override void setConcentration(BigDecimal concentration); @Override void setCreationDate(Date creationDate); @Override void setDescription(String description); @Override void setId(long id); @Override void setIdentificationBarcode(String identificationBarcode); @Override void setName(String name); @Override void setAlias(String alias); @Override void setNotes(Collection<Note> notes); @Override void setPlatformType(PlatformType platformType); @Override void setQcPassed(Boolean qcPassed); @Override Long getPreMigrationId(); @Override ConcentrationUnit getConcentrationUnits(); @Override void setConcentrationUnits(ConcentrationUnit concentrationUnits); @Override VolumeUnit getVolumeUnits(); @Override void setVolumeUnits(VolumeUnit volumeUnits); @Override String toString(); @Override ChangeLog createChangeLog(String summary, String columnsChanged, User user); @Override Set<PoolElement> getPoolContents(); @Override void setPoolElements(Set<PoolElement> poolElements); @Override User getLastModifier(); @Override void setLastModifier(User lastModifier); @Override Date getLastModified(); @Override void setLastModified(Date lastModified); @Override User getCreator(); @Override void setCreator(User creator); @Override Date getCreationTime(); @Override void setCreationTime(Date created); @Override String getLongestIndex(); @Override QcTarget getQcTarget(); @Override Date getBarcodeDate(); @Override String getDeleteType(); @Override String getDeleteDescription(); @Override boolean isSaved(); @Override Set<String> getPrioritySubprojectAliases(); @Override Set<ListTransferView> getTransferViews(); @Override T visit(BarcodableVisitor<T> visitor); static final String PREFIX; static final Long UNSAVED_ID; }
@Test public void testLongestReadSingle() { PoolImpl pool = new PoolImpl(); addElement(pool, "AAAAAA"); addElement(pool, "CCCCCC"); addElement(pool, "GGGGGGGG"); addElement(pool, "TTTTTT"); assertEquals("8", pool.getLongestIndex()); }
@Test public void testLongestReadDual() { PoolImpl pool = new PoolImpl(); addElement(pool, "AAAAAA", "AAAAAA"); addElement(pool, "CCCCCC", "CCCCCCCC"); addElement(pool, "GGGGGGGG", "GGGGGG"); addElement(pool, "TTTTTT", "TTTTTT"); assertEquals("8,8", pool.getLongestIndex()); }
@Test public void testLongestReadNone() { PoolImpl pool = new PoolImpl(); assertEquals("0", pool.getLongestIndex()); }