MethodInvocationDataStoreOperation implements DataStoreOperation<Object, K, E> { @Override public String toString() { return method + " on " + instance; } MethodInvocationDataStoreOperation(Object instance, Method method); @Override Object execute(DataStore<K, E> store, RepositoryConfiguration configuration, Invocation invocation); Object getInstance(); Method getMethod(); @Override String toString();  }
@Test public void testToString() throws Exception { final Method method = MappedClass.class.getDeclaredMethod("errorThrowingMethod"); final MappedClass instance = new MappedClass(null); final MethodInvocationDataStoreOperation<Object, Object> operation = new MethodInvocationDataStoreOperation<>( instance, method); assertThat(operation.toString(), is(method + " on " + instance)); }