FieldFromArray implements Extractor<Object, OUT> { @SuppressWarnings("unchecked") @Override public OUT extract(Object in) { return (OUT) Array.get(in, fieldId); } FieldFromArray();  FieldFromArray(int fieldId); @SuppressWarnings("unchecked") @Override OUT extract(Object in);  }
@Test public void testStringArray() { for (int i = 0; i < this.testStringArray.length; i++) { assertEquals(this.testStringArray[i], new FieldFromArray<String>(i).extract(testStringArray)); } }
@Test public void testIntegerArray() { for (int i = 0; i < this.testIntegerArray.length; i++) { assertEquals(this.testIntegerArray[i], new FieldFromArray<String>(i).extract(testIntegerArray)); } }
@Test public void testIntArray() { for (int i = 0; i < this.testIntArray.length; i++) { assertEquals(new Integer(this.testIntArray[i]), new FieldFromArray<Integer>(i).extract(testIntArray)); } }