@Test public void testNewMethod() { long sum = reduceBy(new int[]{1,2,3,4,5,6,7,8}, this, "sum"); okOrDie(sputs("Sum was 36", sum), sum == 36); }
public static long reduceBy( final int[] array, ReduceBy reduceBy ) { long sum = 0; for ( int v : array ) { sum = reduceBy.reduce(sum, v); } return sum; }
Int { public static long reduceBy( final int[] array, ReduceBy reduceBy ) { long sum = 0; for ( int v : array ) { sum = reduceBy.reduce(sum, v); } return sum; } }
Int { public static long reduceBy( final int[] array, ReduceBy reduceBy ) { long sum = 0; for ( int v : array ) { sum = reduceBy.reduce(sum, v); } return sum; }  }
Int { public static long reduceBy( final int[] array, ReduceBy reduceBy ) { long sum = 0; for ( int v : array ) { sum = reduceBy.reduce(sum, v); } return sum; }  static int[] grow( int[] array, final int size ); static int[] grow( int[] array ); static int[] shrink( int[] array, int size ); static int[] compact( int[] array ); static int[] arrayOfInt( final int size ); @Universal static int[] array( final int... array ); @Universal static int lengthOf( int[] array ); @Universal static int len( int[] array ); @Universal static int idx( final int[] array, final int index ); @Universal static int atIndex( final int[] array, final int index ); @Universal static void idx( final int[] array, int index, int value ); @Universal static void atIndex( final int[] array, int index, int value ); @Universal static int[] slc( int[] array, int startIndex, int endIndex ); @Universal static int[] sliceOf( int[] array, int startIndex, int endIndex ); @Universal static int[] slc( int[] array, int startIndex ); @Universal static int[] sliceOf( int[] array, int startIndex ); @Universal static int[] slcEnd( int[] array, int endIndex ); @Universal static int[] endSliceOf( int[] array, int endIndex ); @Universal static boolean in( int value, int[] array ); @Universal static int[] copy( int[] array ); @Universal static int[] add( int[] array, int v ); @Universal static int[] add( int[] array, int[] array2 ); @Universal static int[] insert( final int[] array, final int idx, final int v ); @Universal static int[] insert( final int[] array, final int fromIndex, final int[] values ); static long reduceBy( final int[] array, ReduceBy reduceBy ); static long reduceBy( final int[] array, final int start, final int length, ReduceBy reduceBy ); static long reduceBy( final int[] array, final int length, ReduceBy reduceBy ); static long reduceBy( final int[] array, T object ); static long reduceBy( final int[] array, T object, String methodName ); static long reduceBy( final int[] array,  int length,
                                 Object object ); static long reduceBy( final int[] array,  int length,
                                 Object function, String functionName ); static long reduceBy( final int[] array, int start, int length,
                                 Object object ); static boolean equalsOrDie(int expected, int got); static boolean equalsOrDie(int[] expected, int[] got); static boolean equals(int expected, int got); static boolean equals(int[] expected, int[] got); static int sum( int[] values ); static int sum( int[] values,  int length ); static int sum( int[] values, int start, int length ); static long bigSum( int[] values ); static long bigSum( int[] values,  int length ); static long bigSum( int[] values, int start, int length ); static int max( int[] values, final int start, final int length ); static int max( int[] values ); static int max( int[] values, int length ); static int min( int[] values, final int start, final int length ); static int min( int[] values ); static int min( int[] values, int length ); static int mean( int[] values, final int start, final int length ); static int mean( int[] values, final int length ); static int mean( int[] values ); static int variance(int[] values, final int start, final int length); static double varianceDouble(int[] values, final int start, final int length); static int variance(int[] values,  final int length); static int variance(int[] values); static int standardDeviation(int[] values, final int start, final int length); static int standardDeviation(int[] values,  final int length); static int standardDeviation(int[] values); static int median(int[] values, final int start, final int length); static int median(int[] values, final int length); static int median(int[] values); static boolean equals(int start, int end, int[] expected, int[] got); static int hashCode(int array[]); static int hashCode(int start, int end, int array[]); static long sum( Collection<?> inputList, String propertyPath ); static double variance(Collection<?> inputList, String propertyPath); static double standardDeviation(Collection<?> inputList, String propertyPath); static int median(Collection<?> inputList, String propertyPath); static int roundUpToPowerOf2( int number ); }
Int { public static long reduceBy( final int[] array, ReduceBy reduceBy ) { long sum = 0; for ( int v : array ) { sum = reduceBy.reduce(sum, v); } return sum; }  static int[] grow( int[] array, final int size ); static int[] grow( int[] array ); static int[] shrink( int[] array, int size ); static int[] compact( int[] array ); static int[] arrayOfInt( final int size ); @Universal static int[] array( final int... array ); @Universal static int lengthOf( int[] array ); @Universal static int len( int[] array ); @Universal static int idx( final int[] array, final int index ); @Universal static int atIndex( final int[] array, final int index ); @Universal static void idx( final int[] array, int index, int value ); @Universal static void atIndex( final int[] array, int index, int value ); @Universal static int[] slc( int[] array, int startIndex, int endIndex ); @Universal static int[] sliceOf( int[] array, int startIndex, int endIndex ); @Universal static int[] slc( int[] array, int startIndex ); @Universal static int[] sliceOf( int[] array, int startIndex ); @Universal static int[] slcEnd( int[] array, int endIndex ); @Universal static int[] endSliceOf( int[] array, int endIndex ); @Universal static boolean in( int value, int[] array ); @Universal static int[] copy( int[] array ); @Universal static int[] add( int[] array, int v ); @Universal static int[] add( int[] array, int[] array2 ); @Universal static int[] insert( final int[] array, final int idx, final int v ); @Universal static int[] insert( final int[] array, final int fromIndex, final int[] values ); static long reduceBy( final int[] array, ReduceBy reduceBy ); static long reduceBy( final int[] array, final int start, final int length, ReduceBy reduceBy ); static long reduceBy( final int[] array, final int length, ReduceBy reduceBy ); static long reduceBy( final int[] array, T object ); static long reduceBy( final int[] array, T object, String methodName ); static long reduceBy( final int[] array,  int length,
                                 Object object ); static long reduceBy( final int[] array,  int length,
                                 Object function, String functionName ); static long reduceBy( final int[] array, int start, int length,
                                 Object object ); static boolean equalsOrDie(int expected, int got); static boolean equalsOrDie(int[] expected, int[] got); static boolean equals(int expected, int got); static boolean equals(int[] expected, int[] got); static int sum( int[] values ); static int sum( int[] values,  int length ); static int sum( int[] values, int start, int length ); static long bigSum( int[] values ); static long bigSum( int[] values,  int length ); static long bigSum( int[] values, int start, int length ); static int max( int[] values, final int start, final int length ); static int max( int[] values ); static int max( int[] values, int length ); static int min( int[] values, final int start, final int length ); static int min( int[] values ); static int min( int[] values, int length ); static int mean( int[] values, final int start, final int length ); static int mean( int[] values, final int length ); static int mean( int[] values ); static int variance(int[] values, final int start, final int length); static double varianceDouble(int[] values, final int start, final int length); static int variance(int[] values,  final int length); static int variance(int[] values); static int standardDeviation(int[] values, final int start, final int length); static int standardDeviation(int[] values,  final int length); static int standardDeviation(int[] values); static int median(int[] values, final int start, final int length); static int median(int[] values, final int length); static int median(int[] values); static boolean equals(int start, int end, int[] expected, int[] got); static int hashCode(int array[]); static int hashCode(int start, int end, int array[]); static long sum( Collection<?> inputList, String propertyPath ); static double variance(Collection<?> inputList, String propertyPath); static double standardDeviation(Collection<?> inputList, String propertyPath); static int median(Collection<?> inputList, String propertyPath); static int roundUpToPowerOf2( int number );  }