### Question:
Fields implements Comparable, Iterable<Comparable>, Serializable, Comparator<Tuple> { public Fields selectPos( Fields selector ) { return selectPos( selector, 0 ); } protected  Fields( Kind kind );  Fields(); @ConstructorProperties({"fields"})  Fields( Comparable... fields ); @ConstructorProperties({"field", "type"})  Fields( Comparable field, Type type ); @ConstructorProperties({"fields", "types"})  Fields( Comparable[] fields, Type[] types ); @ConstructorProperties({"types"})  Fields( Type... types ); static Fields[] fields( Fields... fields ); static Comparable[] names( Comparable... names ); static Type[] types( Type... types ); static Fields size( int size ); static Fields size( int size, Type type ); static Fields join( Fields... fields ); static Fields join( boolean maskDuplicateNames, Fields... fields ); static Fields mask( Fields fields, Fields mask ); static Fields merge( Fields... fields ); static Fields copyComparators( Fields toFields, Fields... fromFields ); static Fields offsetSelector( int size, int startPos ); static Fields resolve( Fields selector, Fields... fields ); static Fields asDeclaration( Fields fields ); boolean isUnOrdered(); boolean isOrdered(); boolean isDefined(); boolean isOutSelector(); boolean isArgSelector(); boolean isDeclarator(); boolean isNone(); boolean isAll(); boolean isUnknown(); boolean isArguments(); boolean isValues(); boolean isResults(); boolean isReplace(); boolean isSwap(); boolean isGroup(); boolean isSubstitution(); final Comparable get( int i ); int[] getPos(); boolean hasRelativePos(); final int[] getPos( Fields fields ); int getPos( Comparable fieldName ); Iterator iterator(); Iterator<Fields> fieldsIterator(); Fields select( Fields selector ); Fields selectPos( Fields selector ); Fields selectPos( Fields selector, int offset ); Fields subtract( Fields fields ); Fields append( Fields fields ); Fields appendSelector( Fields fields ); Fields rename( Fields from, Fields to ); Fields rename( BiFunction<Comparable, Type, Comparable> function ); Fields rename( Function<Comparable, Comparable> function ); Fields renameString( Function<String, Comparable> function ); Fields project( Fields fields ); void verifyContains( Fields fields ); boolean contains( Fields fields ); int compareTo( Fields other ); int compareTo( Object other ); String print(); String printVerbose(); @Override String toString(); final int size(); Fields applyFields( Comparable... fields ); Fields applyType( Comparable fieldName, Type type ); Fields applyTypeToAll( Type type ); Fields applyTypes( Fields fields ); Fields applyTypes( Type... types ); Fields unApplyTypes(); Type getType( Comparable fieldName ); Type getType( int pos ); Class getTypeClass( Comparable fieldName ); Class getTypeClass( int pos ); Type[] getTypes(); Class[] getTypesClasses(); final boolean hasTypes(); void setComparator( Comparable fieldName, Comparator comparator ); void setComparators( Comparator... comparators ); Comparator[] getComparators(); boolean hasComparators(); @Override int compare( Tuple lhs, Tuple rhs ); @Override boolean equals( Object object ); boolean equalsFields( Fields fields ); @Override int hashCode(); static final Fields UNKNOWN; static final Fields NONE; static final Fields ALL; static final Fields GROUP; static final Fields VALUES; static final Fields ARGS; static final Fields RESULTS; static final Fields REPLACE; static final Fields SWAP; static final Fields FIRST; static final Fields LAST; }### Answer:
@Test public void testSelectPos() { Fields declarationA = new Fields( 0, 1 ); Fields selectA = new Fields( 0, 1 ); Fields got = declarationA.select( selectA ); assertEquals( "not equal: ", 2, got.size() ); assertEquals( "not equal: ", 0, got.get( 0 ) ); assertEquals( "not equal: ", 1, got.get( 1 ) ); }