### Question:
StatefulFilter implements ISOFilter, Configurable { public int getIgnoredField(int index) { return this.ignoredFields[index]; } StatefulFilter(); String getKeyPrefix(); void setKeyPrefix(String keyPrefix); void setConfiguration(Configuration cfg); void setSpace(String uri); ISOMsg filter(ISOChannel iSOChannel, ISOMsg m, LogEvent evt); boolean isVetoUnmatched(); void setVetoUnmatched(boolean vetoUnmatched); int getMatchDirection(); void setMatchDirection(int matchDirection); int getIgnoredField(int index); int[] getIgnoredFields(); void setIgnoredField(int index, int ignoredFields); void setIgnoredFields(int[] ignoredFields); int getSavedField(int index); int[] getSavedFields(); void setSavedField(int index, int savedFields); void setSavedFields(int[] savedFields); int getKey(int index); int[] getKey(); void setKey(int index, int key); void setKey(int[] key); long getTimeout(); void setTimeout(long timeout); boolean isOverwriteOriginalFields(); void setOverwriteOriginalFields(boolean overwriteOriginalFields);  }### Answer:
@Test public void testGetIgnoredField() throws Throwable { StatefulFilter statefulFilter = new StatefulFilter(); int[] ignoredFields = new int[1]; ignoredFields[0] = -19; statefulFilter.setIgnoredFields(ignoredFields); int result = statefulFilter.getIgnoredField(0); assertEquals(-19, result, "result"); }
@Test public void testGetIgnoredFieldThrowsArrayIndexOutOfBoundsException() throws Throwable { try { new StatefulFilter().getIgnoredField(100); fail("Expected ArrayIndexOutOfBoundsException to be thrown"); } catch (ArrayIndexOutOfBoundsException ex) { if (isJavaVersionAtMost(JAVA_10)) { assertEquals("100", ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Index 100 out of bounds for length 0", ex.getMessage(), "ex.getMessage()"); } } }