InternalBookmark implements Bookmark { public static Bookmark parse( String value ) { if ( value == null ) { return empty(); } return new InternalBookmark( Collections.singleton( value ) ); } private  InternalBookmark( Set<String> values ); static Bookmark empty(); static Bookmark from( Iterable<Bookmark> bookmarks ); static Bookmark parse( String value ); static Bookmark parse( Set<String> values ); @Override boolean isEmpty(); @Override Set<String> values(); @Override boolean equals( Object o ); @Override int hashCode(); @Override String toString();  }
@Test void asBeginTransactionParametersForNonEmptyBookmark() { Bookmark bookmark = InternalBookmark.parse( "SomeBookmark" ); verifyValues( bookmark, "SomeBookmark" ); }
@Test void bookmarkFromSet() { Set<String> input = asSet( "neo4j:bookmark:v1:tx42", "neo4j:bookmark:v1:tx10", "neo4j:bookmark:v1:tx12" ); Bookmark bookmark = InternalBookmark.parse( input ); verifyValues( bookmark, "neo4j:bookmark:v1:tx42", "neo4j:bookmark:v1:tx10", "neo4j:bookmark:v1:tx12" ); }
@Test void asBeginTransactionParametersForBookmarkWithInvalidValue() { Bookmark bookmark = InternalBookmark.parse( asSet( "neo4j:bookmark:v1:tx1", "neo4j:bookmark:v1:txcat", "neo4j:bookmark:v1:tx3" ) ); verifyValues( bookmark, "neo4j:bookmark:v1:tx1", "neo4j:bookmark:v1:txcat", "neo4j:bookmark:v1:tx3" ); }