Created
April 26, 2012 12:59
-
-
Save demoth/2499384 to your computer and use it in GitHub Desktop.
asdfasdf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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