Skip to content

Instantly share code, notes, and snippets.

@demoth
Created April 26, 2012 12:59
Show Gist options
  • Save demoth/2499384 to your computer and use it in GitHub Desktop.
Save demoth/2499384 to your computer and use it in GitHub Desktop.
asdfasdf
public interface Differ<T> {
public Object diff(T t1, T t2);
}
Differ<SomeType> differ = getInstance();
SomeType a[];
int N = a.length();
Object delta;
if (N < 2){
throw new Error("too small");
} else {
delta = differ.diff(a[1], a[0]);
}
for (int i=1; i < N - 1; i++){
if (delta.equals(differ.diff(a[i+1], a[i]))
throw new Error("wrong");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment