### Question:
IndexWriter implements Stoppable { public static IndexFailurePolicy getFailurePolicy(RegionCoprocessorEnvironment env) throws IOException { Configuration conf = env.getConfiguration(); try { IndexFailurePolicy committer = conf.getClass(INDEX_FAILURE_POLICY_CONF_KEY, PhoenixIndexFailurePolicy.class, IndexFailurePolicy.class).newInstance(); return committer; } catch (InstantiationException e) { throw new IOException(e); } catch (IllegalAccessException e) { throw new IOException(e); } } IndexWriter(RegionCoprocessorEnvironment env, String name);  IndexWriter(RegionCoprocessorEnvironment env, String name, boolean disableIndexOnFailure);  IndexWriter(RegionCoprocessorEnvironment env, IndexCommitter indexCommitter, String name, boolean disableIndexOnFailure);  IndexWriter(IndexCommitter committer, IndexFailurePolicy policy,
                     RegionCoprocessorEnvironment env, String name, boolean disableIndexOnFailure);  IndexWriter(IndexCommitter committer, IndexFailurePolicy policy,
      RegionCoprocessorEnvironment env, String name);   IndexWriter(IndexCommitter committer, IndexFailurePolicy policy); static IndexCommitter getCommitter(RegionCoprocessorEnvironment env); static IndexCommitter getCommitter(RegionCoprocessorEnvironment env, Class<? extends IndexCommitter> defaultClass); static IndexFailurePolicy getFailurePolicy(RegionCoprocessorEnvironment env); void writeAndHandleFailure(Multimap<HTableInterfaceReference, Mutation> toWrite,
                                      boolean allowLocalUpdates, int clientVersion); void writeAndHandleFailure(Collection<Pair<Mutation, byte[]>> indexUpdates,
                                    boolean allowLocalUpdates, int clientVersion); void write(Collection<Pair<Mutation, byte[]>> toWrite, int clientVersion); void write(Collection<Pair<Mutation, byte[]>> toWrite, boolean allowLocalUpdates, int clientVersion); void write(Multimap<HTableInterfaceReference, Mutation> toWrite, boolean allowLocalUpdates, int clientVersion); @Override void stop(String why); @Override boolean isStopped(); static final String INDEX_COMMITTER_CONF_KEY; static final String INDEX_FAILURE_POLICY_CONF_KEY; }### Answer:
@Test public void getDefaultFailurePolicy() throws Exception { Configuration conf = new Configuration(false); RegionCoprocessorEnvironment env = Mockito.mock(RegionCoprocessorEnvironment.class); Region region = Mockito.mock(Region.class); Mockito.when(env.getRegion()).thenReturn(region); Mockito.when(env.getConfiguration()).thenReturn(conf); Mockito.when(region.getTableDescriptor()).thenReturn( TableDescriptorBuilder.newBuilder(TableName.valueOf("dummy")).build()); assertNotNull(IndexWriter.getFailurePolicy(env)); }