Skip to content

Instantly share code, notes, and snippets.

@strootman
Last active December 15, 2015 14:19
Show Gist options
  • Save strootman/5274001 to your computer and use it in GitHub Desktop.
Save strootman/5274001 to your computer and use it in GitHub Desktop.
Starts at "testBooleanToSplittableConversion"
public void testBooleanToSplittableConversion(){
testNullCheck(convertBooleanWithCreate(Boolean.FALSE)); // WILL NOT "do stuff"
testNullCheck(convertBooleanWithSplit(Boolean.FALSE)); // WILL "do stuff"
testNullCheck(convertBooleanWithCreate(Boolean.TRUE)); // WILL "do stuff"
testNullCheck(convertBooleanWithSplit(Boolean.TRUE)); // WILL "do stuff"
}
public void testNullCheck(Splittable testval){
if(testval != null){
// "do stuff"
}
}
public Splittable convertBooleanWithCreate(Boolean object) {
if(object == null){
object = Boolean.FALSE;
}
return StringQuoter.create(object);
}
public Splittable convertBooleanWithSplit(Boolean object) {
if(object == null){
object = Boolean.FALSE;
}
return StringQuoter.split(String.valueOf(object));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment