target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void should_get_alert_message_if_people_names_include_don() { String[] peopleNames = new String[]{"Don", "Kent"}; SeparateQueryFromModifier separateQueryFromModifier = new SeparateQueryFromModifier(); String alertMessage = separateQueryFromModifier.checkSecurity(peopleNames); assertEquals("AlertDon", alert... | public String checkSecurity(String[] people) { String found = foundMiscreant(people); return someLaterCode(found); } | SeparateQueryFromModifier { public String checkSecurity(String[] people) { String found = foundMiscreant(people); return someLaterCode(found); } } | SeparateQueryFromModifier { public String checkSecurity(String[] people) { String found = foundMiscreant(people); return someLaterCode(found); } } | SeparateQueryFromModifier { public String checkSecurity(String[] people) { String found = foundMiscreant(people); return someLaterCode(found); } String checkSecurity(String[] people); } | SeparateQueryFromModifier { public String checkSecurity(String[] people) { String found = foundMiscreant(people); return someLaterCode(found); } String checkSecurity(String[] people); } |
@Test public void should_turn_on_light_when_press_first_on_button() { Light light = new Light(); RemoteControl remoteControl = new RemoteControl(light, null, null); remoteControl.on(1); assertTrue(light.status()); } | public void on(int slot) { if (slot == 1) light.on(); if (slot == 2) ceiling.high(); if (slot == 3) { stereo.on(); stereo.setCdStatus(true); stereo.setVolume(11); } } | RemoteControl { public void on(int slot) { if (slot == 1) light.on(); if (slot == 2) ceiling.high(); if (slot == 3) { stereo.on(); stereo.setCdStatus(true); stereo.setVolume(11); } } } | RemoteControl { public void on(int slot) { if (slot == 1) light.on(); if (slot == 2) ceiling.high(); if (slot == 3) { stereo.on(); stereo.setCdStatus(true); stereo.setVolume(11); } } RemoteControl(Light light, Ceiling ceiling, Stereo stereo); } | RemoteControl { public void on(int slot) { if (slot == 1) light.on(); if (slot == 2) ceiling.high(); if (slot == 3) { stereo.on(); stereo.setCdStatus(true); stereo.setVolume(11); } } RemoteControl(Light light, Ceiling ceiling, Stereo stereo); void on(int slot); void off(int slot); } | RemoteControl { public void on(int slot) { if (slot == 1) light.on(); if (slot == 2) ceiling.high(); if (slot == 3) { stereo.on(); stereo.setCdStatus(true); stereo.setVolume(11); } } RemoteControl(Light light, Ceiling ceiling, Stereo stereo); void on(int slot); void off(int slot); } |
@Test public void should_get_alert_message_if_people_names_include_john() { String[] peopleNames = new String[]{"John", "Kent"}; SeparateQueryFromModifier separateQueryFromModifier = new SeparateQueryFromModifier(); String alertMessage = separateQueryFromModifier.checkSecurity(peopleNames); assertEquals("AlertJohn", al... | public String checkSecurity(String[] people) { String found = foundMiscreant(people); return someLaterCode(found); } | SeparateQueryFromModifier { public String checkSecurity(String[] people) { String found = foundMiscreant(people); return someLaterCode(found); } } | SeparateQueryFromModifier { public String checkSecurity(String[] people) { String found = foundMiscreant(people); return someLaterCode(found); } } | SeparateQueryFromModifier { public String checkSecurity(String[] people) { String found = foundMiscreant(people); return someLaterCode(found); } String checkSecurity(String[] people); } | SeparateQueryFromModifier { public String checkSecurity(String[] people) { String found = foundMiscreant(people); return someLaterCode(found); } String checkSecurity(String[] people); } |
@Test public void should_not_get_alert_message_if_people_names_does_include_don_and_john() { String[] peopleNames = new String[]{"Martin", "Kent"}; SeparateQueryFromModifier separateQueryFromModifier = new SeparateQueryFromModifier(); String alertMessage = separateQueryFromModifier.checkSecurity(peopleNames); assertEqu... | public String checkSecurity(String[] people) { String found = foundMiscreant(people); return someLaterCode(found); } | SeparateQueryFromModifier { public String checkSecurity(String[] people) { String found = foundMiscreant(people); return someLaterCode(found); } } | SeparateQueryFromModifier { public String checkSecurity(String[] people) { String found = foundMiscreant(people); return someLaterCode(found); } } | SeparateQueryFromModifier { public String checkSecurity(String[] people) { String found = foundMiscreant(people); return someLaterCode(found); } String checkSecurity(String[] people); } | SeparateQueryFromModifier { public String checkSecurity(String[] people) { String found = foundMiscreant(people); return someLaterCode(found); } String checkSecurity(String[] people); } |
@Test public void should_get_last_reading_name() { HideMethod hideMethod = new HideMethod(); assertEquals("Clean Code", hideMethod.getLastReadingName()); } | public String getLastReadingName() { List<String> readings = Arrays.asList("Refactoring", "Clean Code"); return getLast(readings); } | HideMethod { public String getLastReadingName() { List<String> readings = Arrays.asList("Refactoring", "Clean Code"); return getLast(readings); } } | HideMethod { public String getLastReadingName() { List<String> readings = Arrays.asList("Refactoring", "Clean Code"); return getLast(readings); } } | HideMethod { public String getLastReadingName() { List<String> readings = Arrays.asList("Refactoring", "Clean Code"); return getLast(readings); } String getLastReadingName(); String getLast(List<String > readings); } | HideMethod { public String getLastReadingName() { List<String> readings = Arrays.asList("Refactoring", "Clean Code"); return getLast(readings); } String getLastReadingName(); String getLast(List<String > readings); } |
@Test public void should_get_correct_next_day() { Date previousDate = new Date(2011, 10, 11); DateCalculator calculateDate = new DateCalculator(previousDate); Date nextDay = new Date(2011, 10, 12); assertEquals(nextDay, calculateDate.getDate()); } | public Date getDate() { return new Date(previousDate.getYear(), previousDate.getMonth(), previousDate.getDate() + 1); } | DateCalculator { public Date getDate() { return new Date(previousDate.getYear(), previousDate.getMonth(), previousDate.getDate() + 1); } } | DateCalculator { public Date getDate() { return new Date(previousDate.getYear(), previousDate.getMonth(), previousDate.getDate() + 1); } DateCalculator(Date previousDate); } | DateCalculator { public Date getDate() { return new Date(previousDate.getYear(), previousDate.getMonth(), previousDate.getDate() + 1); } DateCalculator(Date previousDate); Date getDate(); } | DateCalculator { public Date getDate() { return new Date(previousDate.getYear(), previousDate.getMonth(), previousDate.getDate() + 1); } DateCalculator(Date previousDate); Date getDate(); } |
@Test public void should_get_correct_next_day() { Date previousDate = new Date(2011, 11, 11); DateManager calculateDate = new DateManager(previousDate); Date nextDay = new Date(2011, 11, 12); assertEquals(nextDay, calculateDate.getDate()); } | public Date getDate() { return new Date(previousDate.getYear(), previousDate.getMonth(), previousDate.getDate() + 1); } | DateManager { public Date getDate() { return new Date(previousDate.getYear(), previousDate.getMonth(), previousDate.getDate() + 1); } } | DateManager { public Date getDate() { return new Date(previousDate.getYear(), previousDate.getMonth(), previousDate.getDate() + 1); } DateManager(Date previousDate); } | DateManager { public Date getDate() { return new Date(previousDate.getYear(), previousDate.getMonth(), previousDate.getDate() + 1); } DateManager(Date previousDate); Date getDate(); } | DateManager { public Date getDate() { return new Date(previousDate.getYear(), previousDate.getMonth(), previousDate.getDate() + 1); } DateManager(Date previousDate); Date getDate(); } |
@Test public void should_get_correct_telephone_number() { PersonForExtractClass personForExtractClass = new PersonForExtractClass("CA", "01"); assertEquals("(CA) 01", personForExtractClass.getTelephoneNumber()); } | public String getTelephoneNumber() { return ("(" + officeAreaCode + ") ") + officeNumber; } | PersonForExtractClass { public String getTelephoneNumber() { return ("(" + officeAreaCode + ") ") + officeNumber; } } | PersonForExtractClass { public String getTelephoneNumber() { return ("(" + officeAreaCode + ") ") + officeNumber; } PersonForExtractClass(String officeAreaCode, String officeNumber); } | PersonForExtractClass { public String getTelephoneNumber() { return ("(" + officeAreaCode + ") ") + officeNumber; } PersonForExtractClass(String officeAreaCode, String officeNumber); String getTelephoneNumber(); String getName(); void setName(String name); } | PersonForExtractClass { public String getTelephoneNumber() { return ("(" + officeAreaCode + ") ") + officeNumber; } PersonForExtractClass(String officeAreaCode, String officeNumber); String getTelephoneNumber(); String getName(); void setName(String name); } |
@Test public void should_not_include_when_number_is_less_than_low_and_greater_than_high() { IntRange intRange = new IntRange(50, 100); assertFalse(intRange.includes(150)); } | public boolean includes(int arg) { return arg >= low && arg <= high; } | IntRange { public boolean includes(int arg) { return arg >= low && arg <= high; } } | IntRange { public boolean includes(int arg) { return arg >= low && arg <= high; } IntRange(int low, int high); } | IntRange { public boolean includes(int arg) { return arg >= low && arg <= high; } IntRange(int low, int high); boolean includes(int arg); void grow(int factor); } | IntRange { public boolean includes(int arg) { return arg >= low && arg <= high; } IntRange(int low, int high); boolean includes(int arg); void grow(int factor); } |
@Test public void should_include_when_number_is_between_low_and_high() { IntRange intRange = new IntRange(50, 100); assertTrue(intRange.includes(80)); } | public boolean includes(int arg) { return arg >= low && arg <= high; } | IntRange { public boolean includes(int arg) { return arg >= low && arg <= high; } } | IntRange { public boolean includes(int arg) { return arg >= low && arg <= high; } IntRange(int low, int high); } | IntRange { public boolean includes(int arg) { return arg >= low && arg <= high; } IntRange(int low, int high); boolean includes(int arg); void grow(int factor); } | IntRange { public boolean includes(int arg) { return arg >= low && arg <= high; } IntRange(int low, int high); boolean includes(int arg); void grow(int factor); } |
@Test public void should_get_number_of_orders_for_customer() { Order kentOrder1 = new Order("Kent"); Order kentOrder2 = new Order("Kent"); assertEquals("Kent", kentOrder1.getCustomer().getCustomerName()); assertEquals("Kent", kentOrder2.getCustomer().getCustomerName()); } | public String getCustomerName() { return customerName; } | Customer { public String getCustomerName() { return customerName; } } | Customer { public String getCustomerName() { return customerName; } Customer(String customerName); } | Customer { public String getCustomerName() { return customerName; } Customer(String customerName); String getCustomerName(); } | Customer { public String getCustomerName() { return customerName; } Customer(String customerName); String getCustomerName(); } |
@Test public void should_two_currencies_with_the_same_unit_are_equal() { Currency usdCurrency1 = new Currency("USD"); Currency usdCurrency2 = new Currency("USD"); assertEquals(usdCurrency1.getCode(), usdCurrency2.getCode()); } | public String getCode() { return code; } | Currency { public String getCode() { return code; } } | Currency { public String getCode() { return code; } Currency(String code); } | Currency { public String getCode() { return code; } Currency(String code); String getCode(); } | Currency { public String getCode() { return code; } Currency(String code); String getCode(); } |
@Test public void should_turn_off_light_when_press_first_off_button() { Light light = new Light(); RemoteControl remoteControl = new RemoteControl(light, null, null); remoteControl.off(1); assertFalse(light.status()); } | public void off(int slot) { if (slot == 1) light.off(); if (slot == 2) ceiling.off(); if (slot == 3) stereo.off(); } | RemoteControl { public void off(int slot) { if (slot == 1) light.off(); if (slot == 2) ceiling.off(); if (slot == 3) stereo.off(); } } | RemoteControl { public void off(int slot) { if (slot == 1) light.off(); if (slot == 2) ceiling.off(); if (slot == 3) stereo.off(); } RemoteControl(Light light, Ceiling ceiling, Stereo stereo); } | RemoteControl { public void off(int slot) { if (slot == 1) light.off(); if (slot == 2) ceiling.off(); if (slot == 3) stereo.off(); } RemoteControl(Light light, Ceiling ceiling, Stereo stereo); void on(int slot); void off(int slot); } | RemoteControl { public void off(int slot) { if (slot == 1) light.off(); if (slot == 2) ceiling.off(); if (slot == 3) stereo.off(); } RemoteControl(Light light, Ceiling ceiling, Stereo stereo); void on(int slot); void off(int slot); } |
@Test public void should_get_potential_energy() { EnergyCalculator energyCalculator = new EnergyCalculator(); double potentialEnergy = energyCalculator.potentialEnergy(10, 10); assertTrue(potentialEnergy == 981); } | public double potentialEnergy(double mass, double height) { return mass * height * 9.81; } | EnergyCalculator { public double potentialEnergy(double mass, double height) { return mass * height * 9.81; } } | EnergyCalculator { public double potentialEnergy(double mass, double height) { return mass * height * 9.81; } } | EnergyCalculator { public double potentialEnergy(double mass, double height) { return mass * height * 9.81; } double potentialEnergy(double mass, double height); } | EnergyCalculator { public double potentialEnergy(double mass, double height) { return mass * height * 9.81; } double potentialEnergy(double mass, double height); } |
@Test(expected = NullPointerException.class) public void should_throw_exception_given_no_reading() { LifelineSite subject = new LifelineSite(); subject.charge(); } | public Dollars charge() { int usage = readings[0].getAmount() - readings[1].getAmount(); return charge(usage); } | LifelineSite { public Dollars charge() { int usage = readings[0].getAmount() - readings[1].getAmount(); return charge(usage); } } | LifelineSite { public Dollars charge() { int usage = readings[0].getAmount() - readings[1].getAmount(); return charge(usage); } } | LifelineSite { public Dollars charge() { int usage = readings[0].getAmount() - readings[1].getAmount(); return charge(usage); } void addReading(Reading newReading); Dollars charge(); } | LifelineSite { public Dollars charge() { int usage = readings[0].getAmount() - readings[1].getAmount(); return charge(usage); } void addReading(Reading newReading); Dollars charge(); } |
@Test(expected = NullPointerException.class) public void should_throw_exception_given_no_reading() { BusinessSite subject = new BusinessSite(); subject.charge(); } | public Dollars charge() { int usage = readings[lastReading].getAmount() - readings[lastReading - 1].getAmount(); return charge(usage); } | BusinessSite { public Dollars charge() { int usage = readings[lastReading].getAmount() - readings[lastReading - 1].getAmount(); return charge(usage); } } | BusinessSite { public Dollars charge() { int usage = readings[lastReading].getAmount() - readings[lastReading - 1].getAmount(); return charge(usage); } } | BusinessSite { public Dollars charge() { int usage = readings[lastReading].getAmount() - readings[lastReading - 1].getAmount(); return charge(usage); } void addReading(Reading newReading); Dollars charge(); } | BusinessSite { public Dollars charge() { int usage = readings[lastReading].getAmount() - readings[lastReading - 1].getAmount(); return charge(usage); } void addReading(Reading newReading); Dollars charge(); } |
@Test(expected = ArrayIndexOutOfBoundsException.class) public void should_throw_exception_given_no_reading() { ResidentialSite subject = CreateResidentialSite(); subject.charge(); } | public Dollars charge() { int i = 0; while (readings[i] != null) i++; int usage = readings[i - 1].getAmount() - readings[i - 2].getAmount(); Date end = readings[i - 1].getDate(); Date start = readings[i - 2].getDate(); start.setDate(start.getDate() + 1); return charge(usage, start, end); } | ResidentialSite { public Dollars charge() { int i = 0; while (readings[i] != null) i++; int usage = readings[i - 1].getAmount() - readings[i - 2].getAmount(); Date end = readings[i - 1].getDate(); Date start = readings[i - 2].getDate(); start.setDate(start.getDate() + 1); return charge(usage, start, end); } } | ResidentialSite { public Dollars charge() { int i = 0; while (readings[i] != null) i++; int usage = readings[i - 1].getAmount() - readings[i - 2].getAmount(); Date end = readings[i - 1].getDate(); Date start = readings[i - 2].getDate(); start.setDate(start.getDate() + 1); return charge(usage, start, end); } Residential... | ResidentialSite { public Dollars charge() { int i = 0; while (readings[i] != null) i++; int usage = readings[i - 1].getAmount() - readings[i - 2].getAmount(); Date end = readings[i - 1].getDate(); Date start = readings[i - 2].getDate(); start.setDate(start.getDate() + 1); return charge(usage, start, end); } Residential... | ResidentialSite { public Dollars charge() { int i = 0; while (readings[i] != null) i++; int usage = readings[i - 1].getAmount() - readings[i - 2].getAmount(); Date end = readings[i - 1].getDate(); Date start = readings[i - 2].getDate(); start.setDate(start.getDate() + 1); return charge(usage, start, end); } Residential... |
@Test(expected = ArrayIndexOutOfBoundsException.class) public void should_throw_exception_given_no_reading() { DisabilitySite subject = createDisabilitySite(); subject.charge(); } | public Dollars charge() { int i; for (i = 0; readings[i] != null; i++) ; int usage = readings[i - 1].getAmount() - readings[i - 2].getAmount(); Date end = readings[i - 1].getDate(); Date start = readings[i - 2].getDate(); start.setDate(start.getDate() + 1); return charge(usage, start, end); } | DisabilitySite { public Dollars charge() { int i; for (i = 0; readings[i] != null; i++) ; int usage = readings[i - 1].getAmount() - readings[i - 2].getAmount(); Date end = readings[i - 1].getDate(); Date start = readings[i - 2].getDate(); start.setDate(start.getDate() + 1); return charge(usage, start, end); } } | DisabilitySite { public Dollars charge() { int i; for (i = 0; readings[i] != null; i++) ; int usage = readings[i - 1].getAmount() - readings[i - 2].getAmount(); Date end = readings[i - 1].getDate(); Date start = readings[i - 2].getDate(); start.setDate(start.getDate() + 1); return charge(usage, start, end); } Disabilit... | DisabilitySite { public Dollars charge() { int i; for (i = 0; readings[i] != null; i++) ; int usage = readings[i - 1].getAmount() - readings[i - 2].getAmount(); Date end = readings[i - 1].getDate(); Date start = readings[i - 2].getDate(); start.setDate(start.getDate() + 1); return charge(usage, start, end); } Disabilit... | DisabilitySite { public Dollars charge() { int i; for (i = 0; readings[i] != null; i++) ; int usage = readings[i - 1].getAmount() - readings[i - 2].getAmount(); Date end = readings[i - 1].getDate(); Date start = readings[i - 2].getDate(); start.setDate(start.getDate() + 1); return charge(usage, start, end); } Disabilit... |
@Test public void should_turn_on_ceiling_when_press_second_on_button() { Ceiling ceiling = new Ceiling(); RemoteControl remoteControl = new RemoteControl(null, ceiling, null); remoteControl.on(2); assertEquals(CeilingSpeed.High, ceiling.getSpeed()); } | public void on(int slot) { if (slot == 1) light.on(); if (slot == 2) ceiling.high(); if (slot == 3) { stereo.on(); stereo.setCdStatus(true); stereo.setVolume(11); } } | RemoteControl { public void on(int slot) { if (slot == 1) light.on(); if (slot == 2) ceiling.high(); if (slot == 3) { stereo.on(); stereo.setCdStatus(true); stereo.setVolume(11); } } } | RemoteControl { public void on(int slot) { if (slot == 1) light.on(); if (slot == 2) ceiling.high(); if (slot == 3) { stereo.on(); stereo.setCdStatus(true); stereo.setVolume(11); } } RemoteControl(Light light, Ceiling ceiling, Stereo stereo); } | RemoteControl { public void on(int slot) { if (slot == 1) light.on(); if (slot == 2) ceiling.high(); if (slot == 3) { stereo.on(); stereo.setCdStatus(true); stereo.setVolume(11); } } RemoteControl(Light light, Ceiling ceiling, Stereo stereo); void on(int slot); void off(int slot); } | RemoteControl { public void on(int slot) { if (slot == 1) light.on(); if (slot == 2) ceiling.high(); if (slot == 3) { stereo.on(); stereo.setCdStatus(true); stereo.setVolume(11); } } RemoteControl(Light light, Ceiling ceiling, Stereo stereo); void on(int slot); void off(int slot); } |
@Test public void should_turn_off_ceiling_when_press_second_off_button() { Ceiling ceiling = new Ceiling(); RemoteControl remoteControl = new RemoteControl(null, ceiling, null); remoteControl.off(2); assertEquals(CeilingSpeed.Off, ceiling.getSpeed()); } | public void off(int slot) { if (slot == 1) light.off(); if (slot == 2) ceiling.off(); if (slot == 3) stereo.off(); } | RemoteControl { public void off(int slot) { if (slot == 1) light.off(); if (slot == 2) ceiling.off(); if (slot == 3) stereo.off(); } } | RemoteControl { public void off(int slot) { if (slot == 1) light.off(); if (slot == 2) ceiling.off(); if (slot == 3) stereo.off(); } RemoteControl(Light light, Ceiling ceiling, Stereo stereo); } | RemoteControl { public void off(int slot) { if (slot == 1) light.off(); if (slot == 2) ceiling.off(); if (slot == 3) stereo.off(); } RemoteControl(Light light, Ceiling ceiling, Stereo stereo); void on(int slot); void off(int slot); } | RemoteControl { public void off(int slot) { if (slot == 1) light.off(); if (slot == 2) ceiling.off(); if (slot == 3) stereo.off(); } RemoteControl(Light light, Ceiling ceiling, Stereo stereo); void on(int slot); void off(int slot); } |
@Test public void should_turn_on_stereo_when_press_third_on_button() { Stereo stereo = new Stereo(); RemoteControl remoteControl = new RemoteControl(null, null, stereo); remoteControl.on(3); assertTrue(stereo.getStereoStatus()); assertTrue(stereo.getCdStatus()); assertEquals(11, stereo.getVolume()); } | public void on(int slot) { if (slot == 1) light.on(); if (slot == 2) ceiling.high(); if (slot == 3) { stereo.on(); stereo.setCdStatus(true); stereo.setVolume(11); } } | RemoteControl { public void on(int slot) { if (slot == 1) light.on(); if (slot == 2) ceiling.high(); if (slot == 3) { stereo.on(); stereo.setCdStatus(true); stereo.setVolume(11); } } } | RemoteControl { public void on(int slot) { if (slot == 1) light.on(); if (slot == 2) ceiling.high(); if (slot == 3) { stereo.on(); stereo.setCdStatus(true); stereo.setVolume(11); } } RemoteControl(Light light, Ceiling ceiling, Stereo stereo); } | RemoteControl { public void on(int slot) { if (slot == 1) light.on(); if (slot == 2) ceiling.high(); if (slot == 3) { stereo.on(); stereo.setCdStatus(true); stereo.setVolume(11); } } RemoteControl(Light light, Ceiling ceiling, Stereo stereo); void on(int slot); void off(int slot); } | RemoteControl { public void on(int slot) { if (slot == 1) light.on(); if (slot == 2) ceiling.high(); if (slot == 3) { stereo.on(); stereo.setCdStatus(true); stereo.setVolume(11); } } RemoteControl(Light light, Ceiling ceiling, Stereo stereo); void on(int slot); void off(int slot); } |
@Test public void testFromAsset() throws Exception { } | public static Bitmap fromAsset(@NonNull AssetManager assetManager, @NonNull String path, @NonNull PixelateLayer... layers) throws IOException { return fromInputStream(assetManager.open(path), layers); } | Pixelate { public static Bitmap fromAsset(@NonNull AssetManager assetManager, @NonNull String path, @NonNull PixelateLayer... layers) throws IOException { return fromInputStream(assetManager.open(path), layers); } } | Pixelate { public static Bitmap fromAsset(@NonNull AssetManager assetManager, @NonNull String path, @NonNull PixelateLayer... layers) throws IOException { return fromInputStream(assetManager.open(path), layers); } } | Pixelate { public static Bitmap fromAsset(@NonNull AssetManager assetManager, @NonNull String path, @NonNull PixelateLayer... layers) throws IOException { return fromInputStream(assetManager.open(path), layers); } static Bitmap fromAsset(@NonNull AssetManager assetManager, @NonNull String path, @NonNull PixelateLayer.... | Pixelate { public static Bitmap fromAsset(@NonNull AssetManager assetManager, @NonNull String path, @NonNull PixelateLayer... layers) throws IOException { return fromInputStream(assetManager.open(path), layers); } static Bitmap fromAsset(@NonNull AssetManager assetManager, @NonNull String path, @NonNull PixelateLayer.... |
@Test public void testFromInputStream() throws Exception { } | public static Bitmap fromInputStream(@NonNull InputStream inputStream, @NonNull PixelateLayer... layers) throws IOException { Bitmap in = BitmapFactory.decodeStream(inputStream); inputStream.close(); Bitmap out = fromBitmap(in, layers); in.recycle(); return out; } | Pixelate { public static Bitmap fromInputStream(@NonNull InputStream inputStream, @NonNull PixelateLayer... layers) throws IOException { Bitmap in = BitmapFactory.decodeStream(inputStream); inputStream.close(); Bitmap out = fromBitmap(in, layers); in.recycle(); return out; } } | Pixelate { public static Bitmap fromInputStream(@NonNull InputStream inputStream, @NonNull PixelateLayer... layers) throws IOException { Bitmap in = BitmapFactory.decodeStream(inputStream); inputStream.close(); Bitmap out = fromBitmap(in, layers); in.recycle(); return out; } } | Pixelate { public static Bitmap fromInputStream(@NonNull InputStream inputStream, @NonNull PixelateLayer... layers) throws IOException { Bitmap in = BitmapFactory.decodeStream(inputStream); inputStream.close(); Bitmap out = fromBitmap(in, layers); in.recycle(); return out; } static Bitmap fromAsset(@NonNull AssetManag... | Pixelate { public static Bitmap fromInputStream(@NonNull InputStream inputStream, @NonNull PixelateLayer... layers) throws IOException { Bitmap in = BitmapFactory.decodeStream(inputStream); inputStream.close(); Bitmap out = fromBitmap(in, layers); in.recycle(); return out; } static Bitmap fromAsset(@NonNull AssetManag... |
@Test public void testFromBitmap() throws Exception { } | public static Bitmap fromBitmap(@NonNull Bitmap in, @NonNull PixelateLayer... layers) { Bitmap out = Bitmap.createBitmap(in.getWidth(), in.getHeight(), Bitmap.Config.ARGB_8888); render(in, out, layers); return out; } | Pixelate { public static Bitmap fromBitmap(@NonNull Bitmap in, @NonNull PixelateLayer... layers) { Bitmap out = Bitmap.createBitmap(in.getWidth(), in.getHeight(), Bitmap.Config.ARGB_8888); render(in, out, layers); return out; } } | Pixelate { public static Bitmap fromBitmap(@NonNull Bitmap in, @NonNull PixelateLayer... layers) { Bitmap out = Bitmap.createBitmap(in.getWidth(), in.getHeight(), Bitmap.Config.ARGB_8888); render(in, out, layers); return out; } } | Pixelate { public static Bitmap fromBitmap(@NonNull Bitmap in, @NonNull PixelateLayer... layers) { Bitmap out = Bitmap.createBitmap(in.getWidth(), in.getHeight(), Bitmap.Config.ARGB_8888); render(in, out, layers); return out; } static Bitmap fromAsset(@NonNull AssetManager assetManager, @NonNull String path, @NonNull ... | Pixelate { public static Bitmap fromBitmap(@NonNull Bitmap in, @NonNull PixelateLayer... layers) { Bitmap out = Bitmap.createBitmap(in.getWidth(), in.getHeight(), Bitmap.Config.ARGB_8888); render(in, out, layers); return out; } static Bitmap fromAsset(@NonNull AssetManager assetManager, @NonNull String path, @NonNull ... |
@Test public void testRender() throws Exception { } | public static void render(@NonNull Bitmap in, @NonNull Bitmap out, @NonNull PixelateLayer... layers) { render(in, null, out, layers); } | Pixelate { public static void render(@NonNull Bitmap in, @NonNull Bitmap out, @NonNull PixelateLayer... layers) { render(in, null, out, layers); } } | Pixelate { public static void render(@NonNull Bitmap in, @NonNull Bitmap out, @NonNull PixelateLayer... layers) { render(in, null, out, layers); } } | Pixelate { public static void render(@NonNull Bitmap in, @NonNull Bitmap out, @NonNull PixelateLayer... layers) { render(in, null, out, layers); } static Bitmap fromAsset(@NonNull AssetManager assetManager, @NonNull String path, @NonNull PixelateLayer... layers); static Bitmap fromInputStream(@NonNull InputStream inpu... | Pixelate { public static void render(@NonNull Bitmap in, @NonNull Bitmap out, @NonNull PixelateLayer... layers) { render(in, null, out, layers); } static Bitmap fromAsset(@NonNull AssetManager assetManager, @NonNull String path, @NonNull PixelateLayer... layers); static Bitmap fromInputStream(@NonNull InputStream inpu... |
@Test(groups = "ignore") public void seqTest() throws UnknownHostException { ArangoDatabase db = _fooDao.db(); System.out.println("xxx: " + ArangoUtil.nextSeq(db, "xxx")); System.out.println("xxx: " + ArangoUtil.nextSeq(db, "xxx")); System.out.println("yyy: " + ArangoUtil.nextSeq(db, "yyy")); System.out.println("yyy: "... | public ArangoDatabase db() { return _db; } | ArangoDao { public ArangoDatabase db() { return _db; } } | ArangoDao { public ArangoDatabase db() { return _db; } ArangoDao(Class<E> entityType, ArangoCollection collection); ArangoDao(Class<E> entityType, ArangoCollection collection, IdGenerator idGenerator); } | ArangoDao { public ArangoDatabase db() { return _db; } ArangoDao(Class<E> entityType, ArangoCollection collection); ArangoDao(Class<E> entityType, ArangoCollection collection, IdGenerator idGenerator); ArangoCollection collection(); ArangoCursor<E> cursor(Condition query); ArangoCursor<T> cursor(Condition query, Class... | ArangoDao { public ArangoDatabase db() { return _db; } ArangoDao(Class<E> entityType, ArangoCollection collection); ArangoDao(Class<E> entityType, ArangoCollection collection, IdGenerator idGenerator); ArangoCollection collection(); ArangoCursor<E> cursor(Condition query); ArangoCursor<T> cursor(Condition query, Class... |
@Test public void testWeek() { Matcher matcher; matcher = new CronParser("* * * * * */2").parse(); assertFalse(matcher.match(createTime(1, 2014, 1, 1, 1, 1, 1, true))); assertTrue(matcher.match(createTime(1, 2014, 1, 1, 1, 1, 2, true))); assertFalse(matcher.match(createTime(1, 2014, 1, 1, 1, 1, 3, true))); assertTrue(m... | public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } CronParser(final char[] cron); CronParser(final String cron); } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } CronParser(final char[] cron); CronParser(final String cron); static Matcher parse(String cron); static Matcher parse(final char[] cron); Matcher parse(); } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } CronParser(final char[] cron); CronParser(final String cron); static Matcher parse(String cron); static Matcher parse(final char[] cron); Matcher parse(); } |
@Test public void test() { ActionMacroPath.Parser parser = ActionMacroPath.newParser(); parser.add("/user"); parser.add("GET:/user"); parser.add("GET:/user/$id"); parser.add("GET:/user/1234/send/4567"); parser.add("GET:/user/$id/send/$to"); parser.add("GET:/user/$id/fetch/$to"); ActionMacroPath macroPath = null; macroP... | public static Parser newParser() { return new Parser(); } | ActionMacroPath { public static Parser newParser() { return new Parser(); } } | ActionMacroPath { public static Parser newParser() { return new Parser(); } ActionMacroPath(String key, Map<String, String> params); } | ActionMacroPath { public static Parser newParser() { return new Parser(); } ActionMacroPath(String key, Map<String, String> params); static Parser newParser(); } | ActionMacroPath { public static Parser newParser() { return new Parser(); } ActionMacroPath(String key, Map<String, String> params); static Parser newParser(); final String key; final Map<String, String> params; } |
@Test(groups = {"ignore"}) public void schedule() throws InterruptedException { Scheduler scheduler = new Scheduler(); scheduler.addTask("*", new Task() { @Override public void execute(TaskContext context) { println(" *", context.getTime()); } @Override public String getTaskName() { return "*"; } }); scheduler.addTask(... | public void addTask(String cron, Task task) throws InvalidCronException { initialize(); this.addTask(CronParser.parse(cron), this.executorFactory.createTaskExecutor(task)); } | Scheduler { public void addTask(String cron, Task task) throws InvalidCronException { initialize(); this.addTask(CronParser.parse(cron), this.executorFactory.createTaskExecutor(task)); } } | Scheduler { public void addTask(String cron, Task task) throws InvalidCronException { initialize(); this.addTask(CronParser.parse(cron), this.executorFactory.createTaskExecutor(task)); } Scheduler(); } | Scheduler { public void addTask(String cron, Task task) throws InvalidCronException { initialize(); this.addTask(CronParser.parse(cron), this.executorFactory.createTaskExecutor(task)); } Scheduler(); void setDaemon(boolean daemon); void setTimeZone(int timeZone); void setTimeOffset(int timeOffset); int getTimeOffset();... | Scheduler { public void addTask(String cron, Task task) throws InvalidCronException { initialize(); this.addTask(CronParser.parse(cron), this.executorFactory.createTaskExecutor(task)); } Scheduler(); void setDaemon(boolean daemon); void setTimeZone(int timeZone); void setTimeOffset(int timeOffset); int getTimeOffset();... |
@Test(groups = {"ignore"}) public void schedule3() { final Scheduler scheduler = new Scheduler(); scheduler.addTask("*", new Task() { @Override public void execute(TaskContext context) { println(" click", context.getTime()); throw new RuntimeException("exception"); } @Override public String getTaskName() { return "exce... | public void addTask(String cron, Task task) throws InvalidCronException { initialize(); this.addTask(CronParser.parse(cron), this.executorFactory.createTaskExecutor(task)); } | Scheduler { public void addTask(String cron, Task task) throws InvalidCronException { initialize(); this.addTask(CronParser.parse(cron), this.executorFactory.createTaskExecutor(task)); } } | Scheduler { public void addTask(String cron, Task task) throws InvalidCronException { initialize(); this.addTask(CronParser.parse(cron), this.executorFactory.createTaskExecutor(task)); } Scheduler(); } | Scheduler { public void addTask(String cron, Task task) throws InvalidCronException { initialize(); this.addTask(CronParser.parse(cron), this.executorFactory.createTaskExecutor(task)); } Scheduler(); void setDaemon(boolean daemon); void setTimeZone(int timeZone); void setTimeOffset(int timeOffset); int getTimeOffset();... | Scheduler { public void addTask(String cron, Task task) throws InvalidCronException { initialize(); this.addTask(CronParser.parse(cron), this.executorFactory.createTaskExecutor(task)); } Scheduler(); void setDaemon(boolean daemon); void setTimeZone(int timeZone); void setTimeOffset(int timeOffset); int getTimeOffset();... |
@Test(groups = {"ignore"}) public void schedule4() { final Scheduler scheduler = new Scheduler(); scheduler.addTask("*", new MatchableTask() { @Override public void execute(TaskContext context) { println(" click", context.getTime()); } @Override public String getTaskName() { return "exception"; } @Override public boole... | public void addTask(String cron, Task task) throws InvalidCronException { initialize(); this.addTask(CronParser.parse(cron), this.executorFactory.createTaskExecutor(task)); } | Scheduler { public void addTask(String cron, Task task) throws InvalidCronException { initialize(); this.addTask(CronParser.parse(cron), this.executorFactory.createTaskExecutor(task)); } } | Scheduler { public void addTask(String cron, Task task) throws InvalidCronException { initialize(); this.addTask(CronParser.parse(cron), this.executorFactory.createTaskExecutor(task)); } Scheduler(); } | Scheduler { public void addTask(String cron, Task task) throws InvalidCronException { initialize(); this.addTask(CronParser.parse(cron), this.executorFactory.createTaskExecutor(task)); } Scheduler(); void setDaemon(boolean daemon); void setTimeZone(int timeZone); void setTimeOffset(int timeOffset); int getTimeOffset();... | Scheduler { public void addTask(String cron, Task task) throws InvalidCronException { initialize(); this.addTask(CronParser.parse(cron), this.executorFactory.createTaskExecutor(task)); } Scheduler(); void setDaemon(boolean daemon); void setTimeZone(int timeZone); void setTimeOffset(int timeOffset); int getTimeOffset();... |
@Test public void test() { Matcher matcher; matcher = new CronParser("* * * * *").parse(); matcher = new CronParser("* * *").parse(); matcher = new CronParser("").parse(); matcher = new CronParser("1,3,4 5,6-8 8/3,0-10/2|12,34 * 2,111,33").parse(); matcher = new CronParser("8-10/3,5 1").parse(); int i = 0; } | public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } CronParser(final char[] cron); CronParser(final String cron); } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } CronParser(final char[] cron); CronParser(final String cron); static Matcher parse(String cron); static Matcher parse(final char[] cron); Matcher parse(); } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } CronParser(final char[] cron); CronParser(final String cron); static Matcher parse(String cron); static Matcher parse(final char[] cron); Matcher parse(); } |
@Test public void testMinute() { Matcher matcher; assertSame(Matcher.MATCH_ALL, new CronParser((String) null).parse()); assertSame(Matcher.MATCH_ALL, new CronParser("* *").parse()); assertSame(Matcher.MATCH_ALL, new CronParser("* * *").parse()); assertSame(Matcher.MATCH_ALL, new CronParser("* * * * * * * * *").parse())... | public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } CronParser(final char[] cron); CronParser(final String cron); } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } CronParser(final char[] cron); CronParser(final String cron); static Matcher parse(String cron); static Matcher parse(final char[] cron); Matcher parse(); } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } CronParser(final char[] cron); CronParser(final String cron); static Matcher parse(String cron); static Matcher parse(final char[] cron); Matcher parse(); } |
@Test public void testHour() { Matcher matcher; matcher = new CronParser("3,5,8 1,2,3 * *").parse(); assertFalse(matcher.match(createTime(1, 1, 1, 1, 1, 0, 1, true))); assertFalse(matcher.match(createTime(1, 1, 1, 1, 1, 1, 1, true))); assertFalse(matcher.match(createTime(1, 1, 1, 1, 1, 2, 1, true))); assertTrue(matcher... | public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } CronParser(final char[] cron); CronParser(final String cron); } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } CronParser(final char[] cron); CronParser(final String cron); static Matcher parse(String cron); static Matcher parse(final char[] cron); Matcher parse(); } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } CronParser(final char[] cron); CronParser(final String cron); static Matcher parse(String cron); static Matcher parse(final char[] cron); Matcher parse(); } |
@Test public void testDay() { Matcher matcher; matcher = new CronParser("* * 2,4,*/3 *").parse(); assertTrue(matcher.match(createTime(1, 1, 1, 0, 1, 1, 1, true))); assertFalse(matcher.match(createTime(1, 1, 1, 1, 1, 1, 1, true))); assertTrue(matcher.match(createTime(1, 1, 1, 2, 1, 1, 1, true))); assertTrue(matcher.matc... | public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } CronParser(final char[] cron); CronParser(final String cron); } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } CronParser(final char[] cron); CronParser(final String cron); static Matcher parse(String cron); static Matcher parse(final char[] cron); Matcher parse(); } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } CronParser(final char[] cron); CronParser(final String cron); static Matcher parse(String cron); static Matcher parse(final char[] cron); Matcher parse(); } |
@Test public void testMouth() { Matcher matcher; matcher = new CronParser("* * * */2 * *").parse(); assertFalse(matcher.match(createTime(1, 2014, 1, 1, 1, 1, 1, true))); assertTrue(matcher.match(createTime(1, 2014, 2, 1, 1, 1, 1, true))); assertFalse(matcher.match(createTime(1, 2014, 3, 1, 1, 1, 1, true))); assertTrue(... | public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } CronParser(final char[] cron); CronParser(final String cron); } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } CronParser(final char[] cron); CronParser(final String cron); static Matcher parse(String cron); static Matcher parse(final char[] cron); Matcher parse(); } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } CronParser(final char[] cron); CronParser(final String cron); static Matcher parse(String cron); static Matcher parse(final char[] cron); Matcher parse(); } |
@Test public void testYear() { Matcher matcher; matcher = new CronParser("* * * * */2 *").parse(); assertTrue(matcher.match(createTime(1, 2010, 1, 1, 1, 1, 1, true))); assertFalse(matcher.match(createTime(1, 2011, 1, 1, 1, 1, 1, true))); assertTrue(matcher.match(createTime(1, 2012, 1, 1, 1, 1, 1, true))); assertFalse(m... | public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } CronParser(final char[] cron); CronParser(final String cron); } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } CronParser(final char[] cron); CronParser(final String cron); static Matcher parse(String cron); static Matcher parse(final char[] cron); Matcher parse(); } | CronParser { public static Matcher parse(String cron) throws InvalidCronException { return new CronParser(cron).parse(); } CronParser(final char[] cron); CronParser(final String cron); static Matcher parse(String cron); static Matcher parse(final char[] cron); Matcher parse(); } |
@Test public void shouldReturnValidRepositoryName() throws Exception { assertEquals("sample", clusteringController.getRepositoryName()); } | public String getRepositoryName() throws RepositoryException{ Session repositorySession = newSession(); try { return repositorySession.getRepository().getDescriptor(org.modeshape.jcr.api.Repository.REPOSITORY_NAME); } finally { repositorySession.logout(); } } | ClusteringController { public String getRepositoryName() throws RepositoryException{ Session repositorySession = newSession(); try { return repositorySession.getRepository().getDescriptor(org.modeshape.jcr.api.Repository.REPOSITORY_NAME); } finally { repositorySession.logout(); } } } | ClusteringController { public String getRepositoryName() throws RepositoryException{ Session repositorySession = newSession(); try { return repositorySession.getRepository().getDescriptor(org.modeshape.jcr.api.Repository.REPOSITORY_NAME); } finally { repositorySession.logout(); } } } | ClusteringController { public String getRepositoryName() throws RepositoryException{ Session repositorySession = newSession(); try { return repositorySession.getRepository().getDescriptor(org.modeshape.jcr.api.Repository.REPOSITORY_NAME); } finally { repositorySession.logout(); } } void setNewNodeName( String newNodeN... | ClusteringController { public String getRepositoryName() throws RepositoryException{ Session repositorySession = newSession(); try { return repositorySession.getRepository().getDescriptor(org.modeshape.jcr.api.Repository.REPOSITORY_NAME); } finally { repositorySession.logout(); } } void setNewNodeName( String newNodeN... |
@Test public void shouldReturnValidRepositoryName() throws Exception { assertEquals("federated-repository", federationController.getRepositoryName()); } | public String getRepositoryName() throws RepositoryException{ Session repositorySession = newSession(); try { return repositorySession.getRepository().getDescriptor(org.modeshape.jcr.api.Repository.REPOSITORY_NAME); } finally { repositorySession.logout(); } } | FederationController { public String getRepositoryName() throws RepositoryException{ Session repositorySession = newSession(); try { return repositorySession.getRepository().getDescriptor(org.modeshape.jcr.api.Repository.REPOSITORY_NAME); } finally { repositorySession.logout(); } } } | FederationController { public String getRepositoryName() throws RepositoryException{ Session repositorySession = newSession(); try { return repositorySession.getRepository().getDescriptor(org.modeshape.jcr.api.Repository.REPOSITORY_NAME); } finally { repositorySession.logout(); } } } | FederationController { public String getRepositoryName() throws RepositoryException{ Session repositorySession = newSession(); try { return repositorySession.getRepository().getDescriptor(org.modeshape.jcr.api.Repository.REPOSITORY_NAME); } finally { repositorySession.logout(); } } Map<String, String> getExternalSourc... | FederationController { public String getRepositoryName() throws RepositoryException{ Session repositorySession = newSession(); try { return repositorySession.getRepository().getDescriptor(org.modeshape.jcr.api.Repository.REPOSITORY_NAME); } finally { repositorySession.logout(); } } Map<String, String> getExternalSourc... |
@Test public void shouldProduceValidSession() throws Exception { assertNotNull(sessionProducer); assertNotNull(sessionProducer.getSession()); } | @RequestScoped @Produces public Session getSession() throws RepositoryException { LOGGER.info("Creating new session..."); return sampleRepository.login(); } | SessionProducer { @RequestScoped @Produces public Session getSession() throws RepositoryException { LOGGER.info("Creating new session..."); return sampleRepository.login(); } } | SessionProducer { @RequestScoped @Produces public Session getSession() throws RepositoryException { LOGGER.info("Creating new session..."); return sampleRepository.login(); } } | SessionProducer { @RequestScoped @Produces public Session getSession() throws RepositoryException { LOGGER.info("Creating new session..."); return sampleRepository.login(); } @RequestScoped @Produces Session getSession(); void logoutSession( @Disposes final Session session ); } | SessionProducer { @RequestScoped @Produces public Session getSession() throws RepositoryException { LOGGER.info("Creating new session..."); return sampleRepository.login(); } @RequestScoped @Produces Session getSession(); void logoutSession( @Disposes final Session session ); } |
@Test public void shouldReturnValidRepositoryName() throws Exception { assertEquals("sample", cdiController.getRepositoryName()); } | public String getRepositoryName() { return repositorySession.getRepository().getDescriptor(org.modeshape.jcr.api.Repository.REPOSITORY_NAME); } | CDIController { public String getRepositoryName() { return repositorySession.getRepository().getDescriptor(org.modeshape.jcr.api.Repository.REPOSITORY_NAME); } } | CDIController { public String getRepositoryName() { return repositorySession.getRepository().getDescriptor(org.modeshape.jcr.api.Repository.REPOSITORY_NAME); } } | CDIController { public String getRepositoryName() { return repositorySession.getRepository().getDescriptor(org.modeshape.jcr.api.Repository.REPOSITORY_NAME); } void setNewNodeName( String newNodeName ); String getNewNodeName(); String getParentPath(); void setParentPath( String parentPath ); Set<String> getChildren();... | CDIController { public String getRepositoryName() { return repositorySession.getRepository().getDescriptor(org.modeshape.jcr.api.Repository.REPOSITORY_NAME); } void setNewNodeName( String newNodeName ); String getNewNodeName(); String getParentPath(); void setParentPath( String parentPath ); Set<String> getChildren();... |
@Test public void testCreateRandomFormulaWithRespectToMaxM() { ITabularFormula formula = Helper.createRandomFormula(new Random(), 3, 6); assertEquals(3, formula.getVarCount()); try { formula = Helper.createRandomFormula(new Random(), 4, 700); Assert.fail("This implementation assumes duplicated triplets are not allowed"... | public static ITabularFormula createRandomFormula(Random random, int varCount, int clausesCount) { int mMax = getMaxNumberOfUniqueTriplets(varCount); if (clausesCount > mMax) { throw new IllegalArgumentException(MessageFormat .format("3-SAT formula of {0} variables may have at most {1} valuable clauses, but requested t... | Helper { public static ITabularFormula createRandomFormula(Random random, int varCount, int clausesCount) { int mMax = getMaxNumberOfUniqueTriplets(varCount); if (clausesCount > mMax) { throw new IllegalArgumentException(MessageFormat .format("3-SAT formula of {0} variables may have at most {1} valuable clauses, but re... | Helper { public static ITabularFormula createRandomFormula(Random random, int varCount, int clausesCount) { int mMax = getMaxNumberOfUniqueTriplets(varCount); if (clausesCount > mMax) { throw new IllegalArgumentException(MessageFormat .format("3-SAT formula of {0} variables may have at most {1} valuable clauses, but re... | Helper { public static ITabularFormula createRandomFormula(Random random, int varCount, int clausesCount) { int mMax = getMaxNumberOfUniqueTriplets(varCount); if (clausesCount > mMax) { throw new IllegalArgumentException(MessageFormat .format("3-SAT formula of {0} variables may have at most {1} valuable clauses, but re... | Helper { public static ITabularFormula createRandomFormula(Random random, int varCount, int clausesCount) { int mMax = getMaxNumberOfUniqueTriplets(varCount); if (clausesCount > mMax) { throw new IllegalArgumentException(MessageFormat .format("3-SAT formula of {0} variables may have at most {1} valuable clauses, but re... |
@Test public void testSwapAB() { ITier tier; tier = new SimpleTier(1, 2, 3); tier.add(_000_instance); tier.swapAB(); assertTrue(tier.contains(_000_instance)); tier = new SimpleTier(1, 2, 3); tier.add(_001_instance); tier.swapAB(); assertTrue(tier.contains(_001_instance)); tier = new SimpleTier(1, 2, 3); tier.add(_010_i... | public void swapAB() { super.swapAB(); if (size == 0) { return; } int keys_oo51oooo = keys_73516240 & 0x30; int keys_oooo62oo = keys_73516240 & 0x0C; keys_73516240 = (byte) ((keys_73516240 & 0xC3) | ((keys_oo51oooo >> 2) & 0x3F) | (keys_oooo62oo << 2)); } | SimpleTier extends SimpleTripletPermutation implements ITier { public void swapAB() { super.swapAB(); if (size == 0) { return; } int keys_oo51oooo = keys_73516240 & 0x30; int keys_oooo62oo = keys_73516240 & 0x0C; keys_73516240 = (byte) ((keys_73516240 & 0xC3) | ((keys_oo51oooo >> 2) & 0x3F) | (keys_oooo62oo << 2)); } } | SimpleTier extends SimpleTripletPermutation implements ITier { public void swapAB() { super.swapAB(); if (size == 0) { return; } int keys_oo51oooo = keys_73516240 & 0x30; int keys_oooo62oo = keys_73516240 & 0x0C; keys_73516240 = (byte) ((keys_73516240 & 0xC3) | ((keys_oo51oooo >> 2) & 0x3F) | (keys_oooo62oo << 2)); } S... | SimpleTier extends SimpleTripletPermutation implements ITier { public void swapAB() { super.swapAB(); if (size == 0) { return; } int keys_oo51oooo = keys_73516240 & 0x30; int keys_oooo62oo = keys_73516240 & 0x0C; keys_73516240 = (byte) ((keys_73516240 & 0xC3) | ((keys_oo51oooo >> 2) & 0x3F) | (keys_oooo62oo << 2)); } S... | SimpleTier extends SimpleTripletPermutation implements ITier { public void swapAB() { super.swapAB(); if (size == 0) { return; } int keys_oo51oooo = keys_73516240 & 0x30; int keys_oooo62oo = keys_73516240 & 0x0C; keys_73516240 = (byte) ((keys_73516240 & 0xC3) | ((keys_oo51oooo >> 2) & 0x3F) | (keys_oooo62oo << 2)); } S... |
@Test public void testSwapAC() { ITier tier; tier = new SimpleTier(1, 2, 3); tier.add(_000_instance); tier.swapAC(); assertTrue(tier.contains(_000_instance)); tier = new SimpleTier(1, 2, 3); tier.add(_001_instance); tier.swapAC(); assertTrue(tier.contains(_100_instance)); tier = new SimpleTier(1, 2, 3); tier.add(_010_i... | public void swapAC() { super.swapAC(); if (size == 0) { return; } int keys_o3o1oooo = keys_73516240 & 0x50; int keys_oooo6o4o = keys_73516240 & 0x0A; keys_73516240 = (byte) ((keys_73516240 & 0xA5) | ((keys_o3o1oooo >> 3) & 0x1F) | (keys_oooo6o4o << 3)); } | SimpleTier extends SimpleTripletPermutation implements ITier { public void swapAC() { super.swapAC(); if (size == 0) { return; } int keys_o3o1oooo = keys_73516240 & 0x50; int keys_oooo6o4o = keys_73516240 & 0x0A; keys_73516240 = (byte) ((keys_73516240 & 0xA5) | ((keys_o3o1oooo >> 3) & 0x1F) | (keys_oooo6o4o << 3)); } } | SimpleTier extends SimpleTripletPermutation implements ITier { public void swapAC() { super.swapAC(); if (size == 0) { return; } int keys_o3o1oooo = keys_73516240 & 0x50; int keys_oooo6o4o = keys_73516240 & 0x0A; keys_73516240 = (byte) ((keys_73516240 & 0xA5) | ((keys_o3o1oooo >> 3) & 0x1F) | (keys_oooo6o4o << 3)); } S... | SimpleTier extends SimpleTripletPermutation implements ITier { public void swapAC() { super.swapAC(); if (size == 0) { return; } int keys_o3o1oooo = keys_73516240 & 0x50; int keys_oooo6o4o = keys_73516240 & 0x0A; keys_73516240 = (byte) ((keys_73516240 & 0xA5) | ((keys_o3o1oooo >> 3) & 0x1F) | (keys_oooo6o4o << 3)); } S... | SimpleTier extends SimpleTripletPermutation implements ITier { public void swapAC() { super.swapAC(); if (size == 0) { return; } int keys_o3o1oooo = keys_73516240 & 0x50; int keys_oooo6o4o = keys_73516240 & 0x0A; keys_73516240 = (byte) ((keys_73516240 & 0xA5) | ((keys_o3o1oooo >> 3) & 0x1F) | (keys_oooo6o4o << 3)); } S... |
@Test public void testSwapBC() { ITier tier; tier = new SimpleTier(1, 2, 3); tier.add(_000_instance); tier.swapBC(); assertTrue(tier.contains(_000_instance)); tier = new SimpleTier(1, 2, 3); tier.add(_001_instance); tier.swapBC(); assertTrue(tier.contains(_010_instance)); tier = new SimpleTier(1, 2, 3); tier.add(_010_i... | public void swapBC() { super.swapBC(); if (size == 0) { return; } int keys_o3ooo2oo = keys_73516240 & 0x44; int keys_oo5ooo4o = keys_73516240 & 0x22; keys_73516240 = (byte) ((keys_73516240 & 0x99) | ((keys_o3ooo2oo >> 1) & 0x7F) | (keys_oo5ooo4o << 1)); } | SimpleTier extends SimpleTripletPermutation implements ITier { public void swapBC() { super.swapBC(); if (size == 0) { return; } int keys_o3ooo2oo = keys_73516240 & 0x44; int keys_oo5ooo4o = keys_73516240 & 0x22; keys_73516240 = (byte) ((keys_73516240 & 0x99) | ((keys_o3ooo2oo >> 1) & 0x7F) | (keys_oo5ooo4o << 1)); } } | SimpleTier extends SimpleTripletPermutation implements ITier { public void swapBC() { super.swapBC(); if (size == 0) { return; } int keys_o3ooo2oo = keys_73516240 & 0x44; int keys_oo5ooo4o = keys_73516240 & 0x22; keys_73516240 = (byte) ((keys_73516240 & 0x99) | ((keys_o3ooo2oo >> 1) & 0x7F) | (keys_oo5ooo4o << 1)); } S... | SimpleTier extends SimpleTripletPermutation implements ITier { public void swapBC() { super.swapBC(); if (size == 0) { return; } int keys_o3ooo2oo = keys_73516240 & 0x44; int keys_oo5ooo4o = keys_73516240 & 0x22; keys_73516240 = (byte) ((keys_73516240 & 0x99) | ((keys_o3ooo2oo >> 1) & 0x7F) | (keys_oo5ooo4o << 1)); } S... | SimpleTier extends SimpleTripletPermutation implements ITier { public void swapBC() { super.swapBC(); if (size == 0) { return; } int keys_o3ooo2oo = keys_73516240 & 0x44; int keys_oo5ooo4o = keys_73516240 & 0x22; keys_73516240 = (byte) ((keys_73516240 & 0x99) | ((keys_o3ooo2oo >> 1) & 0x7F) | (keys_oo5ooo4o << 1)); } S... |
@Test public void testAdjoinRight() { ITier t1 = new SimpleTier(1, 2, 3); t1.add(_000_instance); t1.add(_001_instance); t1.add(_011_instance); ITier t2 = new SimpleTier(2, 3, 4); t2.add(_001_instance); t2.add(_001_instance); t2.add(_111_instance); t1.adjoinRight(t2); assertEquals(2, t1.size()); assertTrue(t1.contains(_... | public void adjoinRight(ITier tier) { int tier_keys_73516240 = ((SimpleTier) tier).keys_73516240; int this_keys_o6o2o4o0 = (((tier_keys_73516240 >> 1) & 0x7F) | tier_keys_73516240) & 0x55; int this_keys_7o3o5o1o = ((this_keys_o6o2o4o0 << 1)); int this_keys_76325410 = (this_keys_o6o2o4o0 | this_keys_7o3o5o1o) & get_keys... | SimpleTier extends SimpleTripletPermutation implements ITier { public void adjoinRight(ITier tier) { int tier_keys_73516240 = ((SimpleTier) tier).keys_73516240; int this_keys_o6o2o4o0 = (((tier_keys_73516240 >> 1) & 0x7F) | tier_keys_73516240) & 0x55; int this_keys_7o3o5o1o = ((this_keys_o6o2o4o0 << 1)); int this_keys_... | SimpleTier extends SimpleTripletPermutation implements ITier { public void adjoinRight(ITier tier) { int tier_keys_73516240 = ((SimpleTier) tier).keys_73516240; int this_keys_o6o2o4o0 = (((tier_keys_73516240 >> 1) & 0x7F) | tier_keys_73516240) & 0x55; int this_keys_7o3o5o1o = ((this_keys_o6o2o4o0 << 1)); int this_keys_... | SimpleTier extends SimpleTripletPermutation implements ITier { public void adjoinRight(ITier tier) { int tier_keys_73516240 = ((SimpleTier) tier).keys_73516240; int this_keys_o6o2o4o0 = (((tier_keys_73516240 >> 1) & 0x7F) | tier_keys_73516240) & 0x55; int this_keys_7o3o5o1o = ((this_keys_o6o2o4o0 << 1)); int this_keys_... | SimpleTier extends SimpleTripletPermutation implements ITier { public void adjoinRight(ITier tier) { int tier_keys_73516240 = ((SimpleTier) tier).keys_73516240; int this_keys_o6o2o4o0 = (((tier_keys_73516240 >> 1) & 0x7F) | tier_keys_73516240) & 0x55; int this_keys_7o3o5o1o = ((this_keys_o6o2o4o0 << 1)); int this_keys_... |
@Test public void testAdjoinLeft() { ITier t1 = new SimpleTier(1, 2, 3); t1.add(_001_instance); t1.add(_011_instance); t1.add(_111_instance); ITier t2 = new SimpleTier(2, 3, 4); t2.add(_000_instance); t2.add(_001_instance); t2.add(_011_instance); t2.adjoinLeft(t1); assertEquals(1, t2.size()); assertTrue(t2.contains(_01... | public void adjoinLeft(ITier tier) { int tier_keys_76325410 = ((SimpleTier) tier).get_keys_76325410(); int this_keys_o3o1o2o0 = (((tier_keys_76325410 >> 1) & 0x7F) | tier_keys_76325410) & 0x55; int this_keys_7o5o6o4o = ((this_keys_o3o1o2o0 << 1)); keys_73516240 = (byte)((this_keys_7o5o6o4o | this_keys_o3o1o2o0) & keys_... | SimpleTier extends SimpleTripletPermutation implements ITier { public void adjoinLeft(ITier tier) { int tier_keys_76325410 = ((SimpleTier) tier).get_keys_76325410(); int this_keys_o3o1o2o0 = (((tier_keys_76325410 >> 1) & 0x7F) | tier_keys_76325410) & 0x55; int this_keys_7o5o6o4o = ((this_keys_o3o1o2o0 << 1)); keys_7351... | SimpleTier extends SimpleTripletPermutation implements ITier { public void adjoinLeft(ITier tier) { int tier_keys_76325410 = ((SimpleTier) tier).get_keys_76325410(); int this_keys_o3o1o2o0 = (((tier_keys_76325410 >> 1) & 0x7F) | tier_keys_76325410) & 0x55; int this_keys_7o5o6o4o = ((this_keys_o3o1o2o0 << 1)); keys_7351... | SimpleTier extends SimpleTripletPermutation implements ITier { public void adjoinLeft(ITier tier) { int tier_keys_76325410 = ((SimpleTier) tier).get_keys_76325410(); int this_keys_o3o1o2o0 = (((tier_keys_76325410 >> 1) & 0x7F) | tier_keys_76325410) & 0x55; int this_keys_7o5o6o4o = ((this_keys_o3o1o2o0 << 1)); keys_7351... | SimpleTier extends SimpleTripletPermutation implements ITier { public void adjoinLeft(ITier tier) { int tier_keys_76325410 = ((SimpleTier) tier).get_keys_76325410(); int this_keys_o3o1o2o0 = (((tier_keys_76325410 >> 1) & 0x7F) | tier_keys_76325410) & 0x55; int this_keys_7o5o6o4o = ((this_keys_o3o1o2o0 << 1)); keys_7351... |
@Test public void testInverse() { ITier t2 = new SimpleTier(1, 2, 3); t2.add(_001_instance); t2.add(_101_instance); t2.inverse(); assertEquals(6, t2.size()); assertTrue(t2.contains(_000_instance)); assertTrue(t2.contains(_010_instance)); assertTrue(t2.contains(_011_instance)); assertTrue(t2.contains(_100_instance)); as... | public void inverse() { keys_73516240 = (byte)(~keys_73516240); size = 8 - size; } | SimpleTier extends SimpleTripletPermutation implements ITier { public void inverse() { keys_73516240 = (byte)(~keys_73516240); size = 8 - size; } } | SimpleTier extends SimpleTripletPermutation implements ITier { public void inverse() { keys_73516240 = (byte)(~keys_73516240); size = 8 - size; } SimpleTier(int a, int b, int c); private SimpleTier(SimpleTier tier); } | SimpleTier extends SimpleTripletPermutation implements ITier { public void inverse() { keys_73516240 = (byte)(~keys_73516240); size = 8 - size; } SimpleTier(int a, int b, int c); private SimpleTier(SimpleTier tier); static SimpleTier createCompleteTier(int a, int b, int c); ITier clone(); void add(ITripletValue triple... | SimpleTier extends SimpleTripletPermutation implements ITier { public void inverse() { keys_73516240 = (byte)(~keys_73516240); size = 8 - size; } SimpleTier(int a, int b, int c); private SimpleTier(SimpleTier tier); static SimpleTier createCompleteTier(int a, int b, int c); ITier clone(); void add(ITripletValue triple... |
@Test public void testConcretize() { SimpleTier tier; tier = SimpleTier.createCompleteTier(1, 2, 3); tier.concretize(1, Value.AllPlain); assertEquals(4, tier.size()); assertTrue(tier.contains(_000_instance)); assertTrue(tier.contains(_001_instance)); assertTrue(tier.contains(_010_instance)); assertTrue(tier.contains(_0... | public void concretize(int varName, Value value) { if (Helper.EnableAssertions) { if (value != Value.AllPlain && value != Value.AllNegative) { throw new IllegalArgumentException( "Value should be one of (" + Value.AllPlain + ", " + Value.AllNegative + ") but was " + value); } } if (getAName() == varName) { keys_7351624... | SimpleTier extends SimpleTripletPermutation implements ITier { public void concretize(int varName, Value value) { if (Helper.EnableAssertions) { if (value != Value.AllPlain && value != Value.AllNegative) { throw new IllegalArgumentException( "Value should be one of (" + Value.AllPlain + ", " + Value.AllNegative + ") bu... | SimpleTier extends SimpleTripletPermutation implements ITier { public void concretize(int varName, Value value) { if (Helper.EnableAssertions) { if (value != Value.AllPlain && value != Value.AllNegative) { throw new IllegalArgumentException( "Value should be one of (" + Value.AllPlain + ", " + Value.AllNegative + ") bu... | SimpleTier extends SimpleTripletPermutation implements ITier { public void concretize(int varName, Value value) { if (Helper.EnableAssertions) { if (value != Value.AllPlain && value != Value.AllNegative) { throw new IllegalArgumentException( "Value should be one of (" + Value.AllPlain + ", " + Value.AllNegative + ") bu... | SimpleTier extends SimpleTripletPermutation implements ITier { public void concretize(int varName, Value value) { if (Helper.EnableAssertions) { if (value != Value.AllPlain && value != Value.AllNegative) { throw new IllegalArgumentException( "Value should be one of (" + Value.AllPlain + ", " + Value.AllNegative + ") bu... |
@Test public void testValueOfA() { SimpleTier tier = new SimpleTier(1, 2, 3); Value value = tier.valueOfA(); assertEquals("Value of empty tier", Value.Mixed, value); tier.add(_000_instance); tier.add(_001_instance); tier.add(_010_instance); tier.add(_011_instance); value = tier.valueOfA(); assertEquals("Value of full a... | public Value valueOfA() { return size == 0 ? Value.Mixed : (byte)(keys_73516240 & 0x0F) == keys_73516240 ? Value.AllPlain : (byte)(keys_73516240 & 0xF0) == keys_73516240 ? Value.AllNegative : Value.Mixed; } | SimpleTier extends SimpleTripletPermutation implements ITier { public Value valueOfA() { return size == 0 ? Value.Mixed : (byte)(keys_73516240 & 0x0F) == keys_73516240 ? Value.AllPlain : (byte)(keys_73516240 & 0xF0) == keys_73516240 ? Value.AllNegative : Value.Mixed; } } | SimpleTier extends SimpleTripletPermutation implements ITier { public Value valueOfA() { return size == 0 ? Value.Mixed : (byte)(keys_73516240 & 0x0F) == keys_73516240 ? Value.AllPlain : (byte)(keys_73516240 & 0xF0) == keys_73516240 ? Value.AllNegative : Value.Mixed; } SimpleTier(int a, int b, int c); private SimpleTi... | SimpleTier extends SimpleTripletPermutation implements ITier { public Value valueOfA() { return size == 0 ? Value.Mixed : (byte)(keys_73516240 & 0x0F) == keys_73516240 ? Value.AllPlain : (byte)(keys_73516240 & 0xF0) == keys_73516240 ? Value.AllNegative : Value.Mixed; } SimpleTier(int a, int b, int c); private SimpleTi... | SimpleTier extends SimpleTripletPermutation implements ITier { public Value valueOfA() { return size == 0 ? Value.Mixed : (byte)(keys_73516240 & 0x0F) == keys_73516240 ? Value.AllPlain : (byte)(keys_73516240 & 0xF0) == keys_73516240 ? Value.AllNegative : Value.Mixed; } SimpleTier(int a, int b, int c); private SimpleTi... |
@Test public void testValueOfB() { SimpleTier tier = new SimpleTier(1, 2, 3); Value value = tier.valueOfB(); assertEquals("Value of empty tier", Value.Mixed, value); tier.add(_000_instance); tier.add(_001_instance); tier.add(_100_instance); tier.add(_101_instance); value = tier.valueOfB(); assertEquals("Value of full b... | public Value valueOfB() { return size == 0 ? Value.Mixed : (byte)(keys_73516240 & 0x33) == keys_73516240 ? Value.AllPlain : (byte)(keys_73516240 & 0xCC) == keys_73516240 ? Value.AllNegative : Value.Mixed; } | SimpleTier extends SimpleTripletPermutation implements ITier { public Value valueOfB() { return size == 0 ? Value.Mixed : (byte)(keys_73516240 & 0x33) == keys_73516240 ? Value.AllPlain : (byte)(keys_73516240 & 0xCC) == keys_73516240 ? Value.AllNegative : Value.Mixed; } } | SimpleTier extends SimpleTripletPermutation implements ITier { public Value valueOfB() { return size == 0 ? Value.Mixed : (byte)(keys_73516240 & 0x33) == keys_73516240 ? Value.AllPlain : (byte)(keys_73516240 & 0xCC) == keys_73516240 ? Value.AllNegative : Value.Mixed; } SimpleTier(int a, int b, int c); private SimpleTi... | SimpleTier extends SimpleTripletPermutation implements ITier { public Value valueOfB() { return size == 0 ? Value.Mixed : (byte)(keys_73516240 & 0x33) == keys_73516240 ? Value.AllPlain : (byte)(keys_73516240 & 0xCC) == keys_73516240 ? Value.AllNegative : Value.Mixed; } SimpleTier(int a, int b, int c); private SimpleTi... | SimpleTier extends SimpleTripletPermutation implements ITier { public Value valueOfB() { return size == 0 ? Value.Mixed : (byte)(keys_73516240 & 0x33) == keys_73516240 ? Value.AllPlain : (byte)(keys_73516240 & 0xCC) == keys_73516240 ? Value.AllNegative : Value.Mixed; } SimpleTier(int a, int b, int c); private SimpleTi... |
@Test public void testValueOfC() { SimpleTier tier = new SimpleTier(1, 2, 3); Value value = tier.valueOfC(); assertEquals("Value of empty tier", Value.Mixed, value); tier.add(_000_instance); tier.add(_010_instance); tier.add(_100_instance); tier.add(_110_instance); value = tier.valueOfC(); assertEquals("Value of full c... | public Value valueOfC() { return size == 0 ? Value.Mixed : (byte)(keys_73516240 & 0x55) == keys_73516240 ? Value.AllPlain : (byte)(keys_73516240 & 0xAA) == keys_73516240 ? Value.AllNegative : Value.Mixed; } | SimpleTier extends SimpleTripletPermutation implements ITier { public Value valueOfC() { return size == 0 ? Value.Mixed : (byte)(keys_73516240 & 0x55) == keys_73516240 ? Value.AllPlain : (byte)(keys_73516240 & 0xAA) == keys_73516240 ? Value.AllNegative : Value.Mixed; } } | SimpleTier extends SimpleTripletPermutation implements ITier { public Value valueOfC() { return size == 0 ? Value.Mixed : (byte)(keys_73516240 & 0x55) == keys_73516240 ? Value.AllPlain : (byte)(keys_73516240 & 0xAA) == keys_73516240 ? Value.AllNegative : Value.Mixed; } SimpleTier(int a, int b, int c); private SimpleTi... | SimpleTier extends SimpleTripletPermutation implements ITier { public Value valueOfC() { return size == 0 ? Value.Mixed : (byte)(keys_73516240 & 0x55) == keys_73516240 ? Value.AllPlain : (byte)(keys_73516240 & 0xAA) == keys_73516240 ? Value.AllNegative : Value.Mixed; } SimpleTier(int a, int b, int c); private SimpleTi... | SimpleTier extends SimpleTripletPermutation implements ITier { public Value valueOfC() { return size == 0 ? Value.Mixed : (byte)(keys_73516240 & 0x55) == keys_73516240 ? Value.AllPlain : (byte)(keys_73516240 & 0xAA) == keys_73516240 ? Value.AllNegative : Value.Mixed; } SimpleTier(int a, int b, int c); private SimpleTi... |
@Test public void testUnify() throws Exception { ICompactTripletsStructure s1 = (ICompactTripletsStructure) Helper.createFormula( new int[] { 1, 2, -3, -1, 2, -3, -1, -2, 3, 2, -3, 4, 2, -3, -4, -2, 3, 4, -2, 3, -4, 3, 4, -5, 3, -4, 5, 3, -4, -5, -3, 4, -5, -3, -4, -5, 4, -5, -6, -4, 5, 6, -4, -5, 6, -4, -5, -6, 5, 6, ... | public static void unify(ObjectArrayList cts) throws EmptyStructureException { if (cts.size() < 2) { throw new IllegalArgumentException("Unification is a q-ary operation where q should be > 1"); } VarPairsIndex index = VarPairsIndexFactory.getInstance().buildIndex(cts); unify(index, ((ICompactTripletsStructureHolder) c... | Helper { public static void unify(ObjectArrayList cts) throws EmptyStructureException { if (cts.size() < 2) { throw new IllegalArgumentException("Unification is a q-ary operation where q should be > 1"); } VarPairsIndex index = VarPairsIndexFactory.getInstance().buildIndex(cts); unify(index, ((ICompactTripletsStructure... | Helper { public static void unify(ObjectArrayList cts) throws EmptyStructureException { if (cts.size() < 2) { throw new IllegalArgumentException("Unification is a q-ary operation where q should be > 1"); } VarPairsIndex index = VarPairsIndexFactory.getInstance().buildIndex(cts); unify(index, ((ICompactTripletsStructure... | Helper { public static void unify(ObjectArrayList cts) throws EmptyStructureException { if (cts.size() < 2) { throw new IllegalArgumentException("Unification is a q-ary operation where q should be > 1"); } VarPairsIndex index = VarPairsIndexFactory.getInstance().buildIndex(cts); unify(index, ((ICompactTripletsStructure... | Helper { public static void unify(ObjectArrayList cts) throws EmptyStructureException { if (cts.size() < 2) { throw new IllegalArgumentException("Unification is a q-ary operation where q should be > 1"); } VarPairsIndex index = VarPairsIndexFactory.getInstance().buildIndex(cts); unify(index, ((ICompactTripletsStructure... |
@Test public void testJoin2BetweenTiers() throws Throwable { for (int a1 = 1; a1 <= 3; a1++) for (int b1 = 1; b1 <= 3; b1++) for (int c1 = 1; c1 <= 3; c1++) for (int a2 = 3; a2 <= 5; a2++) for (int b2 = 3; b2 <= 5; b2++) for (int c2 = 3; c2 <= 5; c2++) for (int a3 = 5; a3 <= 7; a3++) for (int b3 = 5; b3 <= 7; b3++) for... | public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } |
@Test public void testJoin2BetweenTiers_BitsAreOnTheSamePlaces() throws Throwable { for (int a1 = -3; a1 <= 3; a1 = a1 == -1 ? 1 : a1+1) for (int b1 = -3; b1 <= 3; b1 = b1 == -1 ? 1 : b1+1) for (int c1 = -3; c1 <= 3; c1 = c1 == -1 ? 1 : c1+1) for (int a2 = -5; a2 <= 5; a2 = a2 == -3 ? 3 : a2+1) for (int b2 = -5; b2 <= ... | public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } |
@Test public void testJoin2BetweenTiers_ThreeTiers() throws Throwable { Join2BetweenTiers method = new Join2BetweenTiers(); ITabularFormula formula = createFormula(1, 2, 3, 2, 3, 4, 6, 7, 8); SimpleTier tier = new SimpleTier(4, 5, 6); tier.add(_101_instance); try { assertTrue("Should join", method.tryJoin(formula, tier... | public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } |
@Test public void testJoin2BetweenTiers_ThreeTiers2() throws Throwable { Join2BetweenTiers method = new Join2BetweenTiers(); ITabularFormula formula = createFormula(1, 2, 3, 3, 5, 4, 8, 7, 9); SimpleTier tier = new SimpleTier(5, 6, 7); tier.add(_101_instance); try { assertTrue("Should join", method.tryJoin(formula, tie... | public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } |
@Test public void testJoin2BetweenTiers_ThreeTiers4() throws EmptyStructureException { Join2BetweenTiers method = new Join2BetweenTiers(); ITabularFormula formula = createFormula(1, 2, 3, 3, 5, 4, 11, 12, 13, 7, 8, 9, 8, 9, 10); SimpleTier tier = new SimpleTier(5, 6, 7); tier.add(_101_instance); try { assertTrue("Shoul... | public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } |
@Test public void tryJoin3BetweenTiers_2Left1Right() throws Throwable { for (int a1 = 1; a1 <= 3; a1++) for (int b1 = 1; b1 <= 3; b1++) for (int c1 = 1; c1 <= 3; c1++) for (int a2 = 1; a2 <= 3; a2++) for (int b2 = 1; b2 <= 3; b2++) for (int c2 = 4; c2 <= 6; c2++) for (int a3 = 4; a3 <= 6; a3++) for (int b3 = 4; b3 <= 6... | public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } |
@Test public void tryJoin3BetweenTiers_2Left1Right_BitsAreOnTheSamePlaces() throws Throwable { for (int a1 = -3; a1 <= 3; a1 = a1 == -1 ? 1 : a1+1) for (int b1 = -3; b1 <= 3; b1 = b1 == -1 ? 1 : b1+1) for (int c1 = -3; c1 <= 3; c1 = c1 == -1 ? 1 : c1+1) for (int a2 = -3; a2 <= 3; a2 = a2 == -1 ? 1 : a2+1) for (int b2 =... | public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } |
@Test public void testJoin3BetweenTiers_2Left1Right_ThreeTiers() throws EmptyStructureException { Join3BetweenTiers method = new Join3BetweenTiers(); ITabularFormula formula = createFormula(1, 2, 3, 4, 5, 6, 7, 8, 9); SimpleTier tier = new SimpleTier(2, 3, 7); tier.add(_101_instance); assertTrue("Should join", method.t... | public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } |
@Test public void testJoin3BetweenTiers_2Left1Right_ThreeTiers2() throws EmptyStructureException { Join3BetweenTiers method = new Join3BetweenTiers(); ITabularFormula formula = createFormula(1, 2, 3, 2, 3, 4, 4, 6, 5, 7, 8, 9); SimpleTier tier = new SimpleTier(5, 6, 7); tier.add(_101_instance); assertTrue("Should join"... | public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } |
@Test public void testJoin3BetweenTiers_2Left1Right_ThreeTiers3() throws EmptyStructureException { Join3BetweenTiers method = new Join3BetweenTiers(); ITabularFormula formula = createFormula(1, 2, 3, 4, 5, 6, 5, 6, 7, 8, 9, 10); SimpleTier tier = new SimpleTier(2, 3, 8); tier.add(_101_instance); assertTrue("Should join... | public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } |
@Test public void testGetCanonicalVarName3() { assertEquals(3, Helper.getCanonicalVarName3(1, 2, new int[] {1, 2, 3})); assertEquals(3, Helper.getCanonicalVarName3(2, 1, new int[] {1, 2, 3})); assertEquals(1, Helper.getCanonicalVarName3(2, 3, new int[] {1, 2, 3})); assertEquals(1, Helper.getCanonicalVarName3(3, 2, new ... | public static int getCanonicalVarName3(int varName1, int varName2, int[] canonicalName) { int varName3; if (varName1 == canonicalName[1]) { if (varName2 == canonicalName[2]) { varName3 = canonicalName[0]; } else { varName3 = canonicalName[2]; } } else { if (varName2 == canonicalName[1]) { if (varName1 > varName2) { var... | Helper { public static int getCanonicalVarName3(int varName1, int varName2, int[] canonicalName) { int varName3; if (varName1 == canonicalName[1]) { if (varName2 == canonicalName[2]) { varName3 = canonicalName[0]; } else { varName3 = canonicalName[2]; } } else { if (varName2 == canonicalName[1]) { if (varName1 > varNam... | Helper { public static int getCanonicalVarName3(int varName1, int varName2, int[] canonicalName) { int varName3; if (varName1 == canonicalName[1]) { if (varName2 == canonicalName[2]) { varName3 = canonicalName[0]; } else { varName3 = canonicalName[2]; } } else { if (varName2 == canonicalName[1]) { if (varName1 > varNam... | Helper { public static int getCanonicalVarName3(int varName1, int varName2, int[] canonicalName) { int varName3; if (varName1 == canonicalName[1]) { if (varName2 == canonicalName[2]) { varName3 = canonicalName[0]; } else { varName3 = canonicalName[2]; } } else { if (varName2 == canonicalName[1]) { if (varName1 > varNam... | Helper { public static int getCanonicalVarName3(int varName1, int varName2, int[] canonicalName) { int varName3; if (varName1 == canonicalName[1]) { if (varName2 == canonicalName[2]) { varName3 = canonicalName[0]; } else { varName3 = canonicalName[2]; } } else { if (varName2 == canonicalName[1]) { if (varName1 > varNam... |
@Test public void tryJoin3BetweenTiers_1Left2Right() throws EmptyStructureException { for (int a1 = 1; a1 <= 3; a1++) for (int b1 = 1; b1 <= 3; b1++) for (int c1 = 1; c1 <= 3; c1++) for (int a2 = 1; a2 <= 3; a2++) for (int b2 = 4; b2 <= 6; b2++) for (int c2 = 4; c2 <= 6; c2++) for (int a3 = 4; a3 <= 6; a3++) for (int b... | public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } |
@Test public void tryJoin3BetweenTiers_1Left2Right_BitsAreOnTheSamePlaces() throws EmptyStructureException { for (int a1 = -3; a1 <= 3; a1 = a1 == -1 ? 1 : a1+1) for (int b1 = -3; b1 <= 3; b1 = b1 == -1 ? 1 : b1+1) for (int c1 = -3; c1 <= 3; c1 = c1 == -1 ? 1 : c1+1) for (int a2 = -3; a2 <= 3; a2 = a2 == -1 ? 1 : a2+1)... | public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } |
@Test public void testJoin3BetweenTiers_1Left2Right_ThreeTiers() throws EmptyStructureException { Join3BetweenTiers method = new Join3BetweenTiers(); ITabularFormula formula = createFormula(1, 2, 3, 4, 5, 6, 7, 8, 9); SimpleTier tier = new SimpleTier(3, 7, 8); tier.add(_101_instance); assertTrue("Should join", method.t... | public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } |
@Test public void testJoin3BetweenTiers_1Left2Right_ThreeTiers2() throws EmptyStructureException { Join3BetweenTiers method = new Join3BetweenTiers(); ITabularFormula formula = createFormula(1, 2, 3, 2, 3, 4, 4, 6, 5, 7, 8, 9); SimpleTier tier = new SimpleTier(6, 7, 8); tier.add(_101_instance); assertTrue("Should join"... | public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } |
@Test public void testJoin3BetweenTiers_1Left2Right_ThreeTiers3() throws EmptyStructureException { Join3BetweenTiers method = new Join3BetweenTiers(); ITabularFormula formula = createFormula(1, 2, 3, 4, 5, 6, 5, 6, 7, 8, 9, 10); SimpleTier tier = new SimpleTier(3, 8, 9); tier.add(_101_instance); assertTrue("Should join... | public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } |
@Test public void testJoin3BetweenTiers_1Left2Right_ThreeTiers4() throws EmptyStructureException { Join3BetweenTiers method = new Join3BetweenTiers(); ITabularFormula formula = createFormula(1, 3, 8, 5, 6, 7); SimpleTier tier = new SimpleTier(6, 8, 7); tier.add(_101_instance); assertTrue("Should join", method.tryJoin(f... | public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } |
@Test public void tryJoin1Left() throws EmptyStructureException { for (int a1 = 1; a1 <= 3; a1++) for (int b1 = 1; b1 <= 3; b1++) for (int c1 = 1; c1 <= 3; c1++) for (int a2 = 3; a2 <= 5; a2++) for (int b2 = 3; b2 <= 5; b2++) for (int c2 = 3; c2 <= 5; c2++) { if (a1 == b1 || a1 == c1 || b1 == c1) continue; if (a2 == b2... | public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } |
@Test public void tryJoin1Left_BitsAreOnTheSamePlaces() throws EmptyStructureException { for (int a1 = -3; a1 <= 3; a1 = a1 == -1 ? 1 : a1+1) for (int b1 = -3; b1 <= 3; b1 = b1 == -1 ? 1 : b1+1) for (int c1 = -3; c1 <= 3; c1 = c1 == -1 ? 1 : c1+1) for (int a2 = -5; a2 <= 5; a2 = a2 == -3 ? 3 : a2+1) for (int b2 = -5; b... | public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } |
@Test public void tryJoin1Right() throws EmptyStructureException { for (int a1 = 1; a1 <= 3; a1++) for (int b1 = 1; b1 <= 3; b1++) for (int c1 = 1; c1 <= 3; c1++) for (int a2 = 3; a2 <= 5; a2++) for (int b2 = 3; b2 <= 5; b2++) for (int c2 = 3; c2 <= 5; c2++) { if (a1 == b1 || a1 == c1 || b1 == c1) continue; if (a2 == b... | public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } |
@Test public void tryJoin1Right_BitsAreOnTheSamePlaces() throws EmptyStructureException { for (int a1 = -3; a1 <= 3; a1 = a1 == -1 ? 1 : a1+1) for (int b1 = -3; b1 <= 3; b1 = b1 == -1 ? 1 : b1+1) for (int c1 = -3; c1 <= 3; c1 = c1 == -1 ? 1 : c1+1) for (int a2 = -5; a2 <= 5; a2 = a2 == -3 ? 3 : a2+1) for (int b2 = -5; ... | public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } |
@Test public void testCreateCTF() { for (int n = 7; n < 100; n++) { try { System.out.println(n); ITabularFormula formula = Helper.createRandomFormula(21, n); ObjectArrayList ctf = Helper.createCTF(formula); Helper.completeToCTS(ctf, formula.getPermutation()); } catch (EmptyStructureException e) { } } } | public static ObjectArrayList createCTF(ITabularFormula formula) { ObjectArrayList ctf = new ObjectArrayList(); ObjectArrayList tiers = formula.getTiers(); ITabularFormula f = new SimpleFormula(); f.unionOrAdd(formula.getTier(0).clone()); ctf.add(f); for (int i = 1; i < tiers.size(); i++) { ITier tier = ((ITier) tiers.... | Helper { public static ObjectArrayList createCTF(ITabularFormula formula) { ObjectArrayList ctf = new ObjectArrayList(); ObjectArrayList tiers = formula.getTiers(); ITabularFormula f = new SimpleFormula(); f.unionOrAdd(formula.getTier(0).clone()); ctf.add(f); for (int i = 1; i < tiers.size(); i++) { ITier tier = ((ITie... | Helper { public static ObjectArrayList createCTF(ITabularFormula formula) { ObjectArrayList ctf = new ObjectArrayList(); ObjectArrayList tiers = formula.getTiers(); ITabularFormula f = new SimpleFormula(); f.unionOrAdd(formula.getTier(0).clone()); ctf.add(f); for (int i = 1; i < tiers.size(); i++) { ITier tier = ((ITie... | Helper { public static ObjectArrayList createCTF(ITabularFormula formula) { ObjectArrayList ctf = new ObjectArrayList(); ObjectArrayList tiers = formula.getTiers(); ITabularFormula f = new SimpleFormula(); f.unionOrAdd(formula.getTier(0).clone()); ctf.add(f); for (int i = 1; i < tiers.size(); i++) { ITier tier = ((ITie... | Helper { public static ObjectArrayList createCTF(ITabularFormula formula) { ObjectArrayList ctf = new ObjectArrayList(); ObjectArrayList tiers = formula.getTiers(); ITabularFormula f = new SimpleFormula(); f.unionOrAdd(formula.getTier(0).clone()); ctf.add(f); for (int i = 1; i < tiers.size(); i++) { ITier tier = ((ITie... |
@Test public void tryJoin2Left() throws EmptyStructureException { for (int a1 = 1; a1 <= 3; a1++) for (int b1 = 1; b1 <= 3; b1++) for (int c1 = 1; c1 <= 3; c1++) for (int a2 = 2; a2 <= 4; a2++) for (int b2 = 2; b2 <= 4; b2++) for (int c2 = 2; c2 <= 4; c2++) { if (a1 == b1 || a1 == c1 || b1 == c1) continue; if (a2 == b2... | public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } |
@Test public void tryJoin2Left_BitsOnTheirPlaces() throws EmptyStructureException { for (int a1 = -3; a1 <= 3; a1 = a1 == -1 ? 1 : a1+1) for (int b1 = -3; b1 <= 3; b1 = b1 == -1 ? 1 : b1+1) for (int c1 = -3; c1 <= 3; c1 = c1 == -1 ? 1 : c1+1) for (int a2 = -4; a2 <= 4; a2 = a2 == -2 ? 2 : a2+1) for (int b2 = -4; b2 <= ... | public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } |
@Test public void tryJoin2Right() throws EmptyStructureException { for (int a1 = 1; a1 <= 3; a1++) for (int b1 = 1; b1 <= 3; b1++) for (int c1 = 1; c1 <= 3; c1++) for (int a2 = 2; a2 <= 4; a2++) for (int b2 = 2; b2 <= 4; b2++) for (int c2 = 2; c2 <= 4; c2++) { if (a1 == b1 || a1 == c1 || b1 == c1) continue; if (a2 == b... | public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } |
@Test public void tryJoin2Right_BitsOnTheirPlaces() throws EmptyStructureException { for (int a1 = -3; a1 <= 3; a1 = a1 == -1 ? 1 : a1+1) for (int b1 = -3; b1 <= 3; b1 = b1 == -1 ? 1 : b1+1) for (int c1 = -3; c1 <= 3; c1 = c1 == -1 ? 1 : c1+1) for (int a2 = -4; a2 <= 4; a2 = a2 == -2 ? 2 : a2+1) for (int b2 = -4; b2 <=... | public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } | Join3AsIs implements IJoinMethod { public boolean tryJoin(ITabularFormula formula, ITier tier) { ITier existingTier = formula.findTierFor(tier); if (existingTier != null) { formula.unionOrAdd(existingTier); return true; } return false; } boolean tryJoin(ITabularFormula formula, ITier tier); } |
@Test public void testConvertCTStructuresToRomanovSKTFileFormat() throws Exception { String filename = "target/test-classes/cnf-v22-c73-12.cnf"; File file = new File(filename); ITabularFormula formula = Helper.loadFromFile(filename); ObjectArrayList ctf = Helper.createCTF(formula); System.out.println("CTF: " + ctf.size... | public static void convertCTStructuresToRomanovSKTFileFormat(ObjectArrayList cts, String filename) throws FileNotFoundException, IOException { OutputStream os = null; try { os = new FileOutputStream(new File(filename)); for (int i = 0; i < cts.size(); i++) { ITabularFormula f = (ITabularFormula) cts.get(i); for (int j ... | Helper { public static void convertCTStructuresToRomanovSKTFileFormat(ObjectArrayList cts, String filename) throws FileNotFoundException, IOException { OutputStream os = null; try { os = new FileOutputStream(new File(filename)); for (int i = 0; i < cts.size(); i++) { ITabularFormula f = (ITabularFormula) cts.get(i); fo... | Helper { public static void convertCTStructuresToRomanovSKTFileFormat(ObjectArrayList cts, String filename) throws FileNotFoundException, IOException { OutputStream os = null; try { os = new FileOutputStream(new File(filename)); for (int i = 0; i < cts.size(); i++) { ITabularFormula f = (ITabularFormula) cts.get(i); fo... | Helper { public static void convertCTStructuresToRomanovSKTFileFormat(ObjectArrayList cts, String filename) throws FileNotFoundException, IOException { OutputStream os = null; try { os = new FileOutputStream(new File(filename)); for (int i = 0; i < cts.size(); i++) { ITabularFormula f = (ITabularFormula) cts.get(i); fo... | Helper { public static void convertCTStructuresToRomanovSKTFileFormat(ObjectArrayList cts, String filename) throws FileNotFoundException, IOException { OutputStream os = null; try { os = new FileOutputStream(new File(filename)); for (int i = 0; i < cts.size(); i++) { ITabularFormula f = (ITabularFormula) cts.get(i); fo... |
@Test public void testIndexOf() { IPermutation sp = new SimplePermutation(); sp.add(4); sp.add(6); sp.add(7); Assert.assertEquals(0, sp.indexOf(4)); Assert.assertEquals(1, sp.indexOf(6)); Assert.assertEquals(2, sp.indexOf(7)); sp.add(1, 9); Assert.assertEquals(0, sp.indexOf(4)); Assert.assertEquals(1, sp.indexOf(9)); A... | public int indexOf(int varName) { return permutationHash.containsKey(varName) ? permutationHash.get(varName) : -1; } | SimplePermutation implements IPermutation { public int indexOf(int varName) { return permutationHash.containsKey(varName) ? permutationHash.get(varName) : -1; } } | SimplePermutation implements IPermutation { public int indexOf(int varName) { return permutationHash.containsKey(varName) ? permutationHash.get(varName) : -1; } SimplePermutation(); } | SimplePermutation implements IPermutation { public int indexOf(int varName) { return permutationHash.containsKey(varName) ? permutationHash.get(varName) : -1; } SimplePermutation(); boolean contains(int varName); int indexOf(int varName); void put(int[] varNames); void add(int varName); void add(int index, int varName)... | SimplePermutation implements IPermutation { public int indexOf(int varName) { return permutationHash.containsKey(varName) ? permutationHash.get(varName) : -1; } SimplePermutation(); boolean contains(int varName); int indexOf(int varName); void put(int[] varNames); void add(int varName); void add(int index, int varName)... |
@Test public void testShiftToStart() { IPermutation permutation = createPermutation(1, 2, 3, 4, 5, 6, 7, 8, 9); permutation.shiftToStart(4, 6); Assert.assertTrue(permutation.sameAs(createPermutation(5, 6, 7, 1, 2, 3, 4, 8, 9))); assertEquals(0, permutation.indexOf(5)); assertEquals(1, permutation.indexOf(6)); assertEqu... | public void shiftToStart(int from, int to) { if (to <= from) { throw new IllegalArgumentException("to <= from"); } int[] buffer = new int[from]; int[] elements = permutation.elements(); System.arraycopy(elements, 0, buffer, 0, from); System.arraycopy(elements, from, elements, 0, to - from + 1); System.arraycopy(buffer,... | SimplePermutation implements IPermutation { public void shiftToStart(int from, int to) { if (to <= from) { throw new IllegalArgumentException("to <= from"); } int[] buffer = new int[from]; int[] elements = permutation.elements(); System.arraycopy(elements, 0, buffer, 0, from); System.arraycopy(elements, from, elements,... | SimplePermutation implements IPermutation { public void shiftToStart(int from, int to) { if (to <= from) { throw new IllegalArgumentException("to <= from"); } int[] buffer = new int[from]; int[] elements = permutation.elements(); System.arraycopy(elements, 0, buffer, 0, from); System.arraycopy(elements, from, elements,... | SimplePermutation implements IPermutation { public void shiftToStart(int from, int to) { if (to <= from) { throw new IllegalArgumentException("to <= from"); } int[] buffer = new int[from]; int[] elements = permutation.elements(); System.arraycopy(elements, 0, buffer, 0, from); System.arraycopy(elements, from, elements,... | SimplePermutation implements IPermutation { public void shiftToStart(int from, int to) { if (to <= from) { throw new IllegalArgumentException("to <= from"); } int[] buffer = new int[from]; int[] elements = permutation.elements(); System.arraycopy(elements, 0, buffer, 0, from); System.arraycopy(elements, from, elements,... |
@Test public void testShiftToEnd() { IPermutation permutation = createPermutation(1, 2, 3, 4, 5, 6, 7, 8, 9); permutation.shiftToEnd(4, 6); Assert.assertTrue(permutation.sameAs(createPermutation(1, 2, 3, 4, 8, 9, 5, 6, 7))); assertEquals(0, permutation.indexOf(1)); assertEquals(1, permutation.indexOf(2)); assertEquals(... | public void shiftToEnd(int from, int to) { if (to <= from) { throw new IllegalArgumentException("to <= from"); } int[] buffer = new int[permutation.size() - to - 1]; int[] elements = permutation.elements(); System.arraycopy(elements, to + 1, buffer, 0, permutation.size() - to - 1); System.arraycopy(elements, from, elem... | SimplePermutation implements IPermutation { public void shiftToEnd(int from, int to) { if (to <= from) { throw new IllegalArgumentException("to <= from"); } int[] buffer = new int[permutation.size() - to - 1]; int[] elements = permutation.elements(); System.arraycopy(elements, to + 1, buffer, 0, permutation.size() - to... | SimplePermutation implements IPermutation { public void shiftToEnd(int from, int to) { if (to <= from) { throw new IllegalArgumentException("to <= from"); } int[] buffer = new int[permutation.size() - to - 1]; int[] elements = permutation.elements(); System.arraycopy(elements, to + 1, buffer, 0, permutation.size() - to... | SimplePermutation implements IPermutation { public void shiftToEnd(int from, int to) { if (to <= from) { throw new IllegalArgumentException("to <= from"); } int[] buffer = new int[permutation.size() - to - 1]; int[] elements = permutation.elements(); System.arraycopy(elements, to + 1, buffer, 0, permutation.size() - to... | SimplePermutation implements IPermutation { public void shiftToEnd(int from, int to) { if (to <= from) { throw new IllegalArgumentException("to <= from"); } int[] buffer = new int[permutation.size() - to - 1]; int[] elements = permutation.elements(); System.arraycopy(elements, to + 1, buffer, 0, permutation.size() - to... |
@Test public void testEvaluate() { ITabularFormula formula = Helper.createFormula(1, 2, 3); ObjectArrayList route = new ObjectArrayList(); route.add(new SimpleVertex(new SimpleTripletPermutation(1, 2, 3), 0, _111_instance, null)); assertTrue(formula.evaluate(route)); } | public boolean evaluate(Properties properties) { boolean result = true; for (int j = 0; j < getTiers().size(); j++) { for (ITripletValue tiplet : getTier(j)) { ITripletPermutation permutation = getTier(j); boolean aValue = parseBoolean(String.valueOf(properties.get("_" + permutation.getAName()))); boolean bValue = pars... | SimpleFormula implements ICompactTripletsStructure, ICompactTripletsStructureHolder { public boolean evaluate(Properties properties) { boolean result = true; for (int j = 0; j < getTiers().size(); j++) { for (ITripletValue tiplet : getTier(j)) { ITripletPermutation permutation = getTier(j); boolean aValue = parseBoolea... | SimpleFormula implements ICompactTripletsStructure, ICompactTripletsStructureHolder { public boolean evaluate(Properties properties) { boolean result = true; for (int j = 0; j < getTiers().size(); j++) { for (ITripletValue tiplet : getTier(j)) { ITripletPermutation permutation = getTier(j); boolean aValue = parseBoolea... | SimpleFormula implements ICompactTripletsStructure, ICompactTripletsStructureHolder { public boolean evaluate(Properties properties) { boolean result = true; for (int j = 0; j < getTiers().size(); j++) { for (ITripletValue tiplet : getTier(j)) { ITripletPermutation permutation = getTier(j); boolean aValue = parseBoolea... | SimpleFormula implements ICompactTripletsStructure, ICompactTripletsStructureHolder { public boolean evaluate(Properties properties) { boolean result = true; for (int j = 0; j < getTiers().size(); j++) { for (ITripletValue tiplet : getTier(j)) { ITripletPermutation permutation = getTier(j); boolean aValue = parseBoolea... |
@Test public void testTripletsIterator() { ITier tier = new SimpleTier(1, 2, 3); tier.add(_000_instance); tier.add(_010_instance); for (ITripletValue tripletValue : tier) { System.out.println(tripletValue); } } | public void add(ITripletValue triplet) { if (!contains(triplet)) { keys_73516240 = (byte)(keys_73516240 | triplet.getTierKey()); size++; } } | SimpleTier extends SimpleTripletPermutation implements ITier { public void add(ITripletValue triplet) { if (!contains(triplet)) { keys_73516240 = (byte)(keys_73516240 | triplet.getTierKey()); size++; } } } | SimpleTier extends SimpleTripletPermutation implements ITier { public void add(ITripletValue triplet) { if (!contains(triplet)) { keys_73516240 = (byte)(keys_73516240 | triplet.getTierKey()); size++; } } SimpleTier(int a, int b, int c); private SimpleTier(SimpleTier tier); } | SimpleTier extends SimpleTripletPermutation implements ITier { public void add(ITripletValue triplet) { if (!contains(triplet)) { keys_73516240 = (byte)(keys_73516240 | triplet.getTierKey()); size++; } } SimpleTier(int a, int b, int c); private SimpleTier(SimpleTier tier); static SimpleTier createCompleteTier(int a, i... | SimpleTier extends SimpleTripletPermutation implements ITier { public void add(ITripletValue triplet) { if (!contains(triplet)) { keys_73516240 = (byte)(keys_73516240 | triplet.getTierKey()); size++; } } SimpleTier(int a, int b, int c); private SimpleTier(SimpleTier tier); static SimpleTier createCompleteTier(int a, i... |
@Test public void shouldBeConnecting() { when(tgDevice.getState()).thenReturn(TGDevice.STATE_CONNECTING); boolean isConnecting = preconditions.isConnecting(tgDevice); assertThat(isConnecting).isTrue(); } | @Override public boolean isConnecting(TGDevice device) { return device != null && device.getState() == TGDevice.STATE_CONNECTING; } | DefaultPreconditions implements Preconditions { @Override public boolean isConnecting(TGDevice device) { return device != null && device.getState() == TGDevice.STATE_CONNECTING; } } | DefaultPreconditions implements Preconditions { @Override public boolean isConnecting(TGDevice device) { return device != null && device.getState() == TGDevice.STATE_CONNECTING; } } | DefaultPreconditions implements Preconditions { @Override public boolean isConnecting(TGDevice device) { return device != null && device.getState() == TGDevice.STATE_CONNECTING; } @Override boolean isConnecting(TGDevice device); @Override boolean isConnected(TGDevice device); @Override boolean canConnect(TGDevice devi... | DefaultPreconditions implements Preconditions { @Override public boolean isConnecting(TGDevice device) { return device != null && device.getState() == TGDevice.STATE_CONNECTING; } @Override boolean isConnecting(TGDevice device); @Override boolean isConnected(TGDevice device); @Override boolean canConnect(TGDevice devi... |
@Test public void bluetoothAdapterShouldBeInitialized() { boolean isInitialized = preconditions.isBluetoothAdapterInitialized(); assertThat(isInitialized).isTrue(); } | @Override public boolean isBluetoothAdapterInitialized() { return isBluetoothAdapterInitialized(BluetoothAdapter.getDefaultAdapter()); } | DefaultPreconditions implements Preconditions { @Override public boolean isBluetoothAdapterInitialized() { return isBluetoothAdapterInitialized(BluetoothAdapter.getDefaultAdapter()); } } | DefaultPreconditions implements Preconditions { @Override public boolean isBluetoothAdapterInitialized() { return isBluetoothAdapterInitialized(BluetoothAdapter.getDefaultAdapter()); } } | DefaultPreconditions implements Preconditions { @Override public boolean isBluetoothAdapterInitialized() { return isBluetoothAdapterInitialized(BluetoothAdapter.getDefaultAdapter()); } @Override boolean isConnecting(TGDevice device); @Override boolean isConnected(TGDevice device); @Override boolean canConnect(TGDevice... | DefaultPreconditions implements Preconditions { @Override public boolean isBluetoothAdapterInitialized() { return isBluetoothAdapterInitialized(BluetoothAdapter.getDefaultAdapter()); } @Override boolean isConnecting(TGDevice device); @Override boolean isConnected(TGDevice device); @Override boolean canConnect(TGDevice... |
@Test public void bluetoothAdapterShouldNotBeInitializedWhenItsNull() { boolean isInitialized = preconditions.isBluetoothAdapterInitialized(null); assertThat(isInitialized).isFalse(); } | @Override public boolean isBluetoothAdapterInitialized() { return isBluetoothAdapterInitialized(BluetoothAdapter.getDefaultAdapter()); } | DefaultPreconditions implements Preconditions { @Override public boolean isBluetoothAdapterInitialized() { return isBluetoothAdapterInitialized(BluetoothAdapter.getDefaultAdapter()); } } | DefaultPreconditions implements Preconditions { @Override public boolean isBluetoothAdapterInitialized() { return isBluetoothAdapterInitialized(BluetoothAdapter.getDefaultAdapter()); } } | DefaultPreconditions implements Preconditions { @Override public boolean isBluetoothAdapterInitialized() { return isBluetoothAdapterInitialized(BluetoothAdapter.getDefaultAdapter()); } @Override boolean isConnecting(TGDevice device); @Override boolean isConnected(TGDevice device); @Override boolean canConnect(TGDevice... | DefaultPreconditions implements Preconditions { @Override public boolean isBluetoothAdapterInitialized() { return isBluetoothAdapterInitialized(BluetoothAdapter.getDefaultAdapter()); } @Override boolean isConnecting(TGDevice device); @Override boolean isConnected(TGDevice device); @Override boolean canConnect(TGDevice... |
@Test public void bluetoothShouldBeEnabled() { when(bluetoothAdapter.isEnabled()).thenReturn(true); boolean isEnabled = preconditions.isBluetoothEnabled(bluetoothAdapter); assertThat(isEnabled).isTrue(); } | @Override public boolean isBluetoothEnabled() { return isBluetoothEnabled(BluetoothAdapter.getDefaultAdapter()); } | DefaultPreconditions implements Preconditions { @Override public boolean isBluetoothEnabled() { return isBluetoothEnabled(BluetoothAdapter.getDefaultAdapter()); } } | DefaultPreconditions implements Preconditions { @Override public boolean isBluetoothEnabled() { return isBluetoothEnabled(BluetoothAdapter.getDefaultAdapter()); } } | DefaultPreconditions implements Preconditions { @Override public boolean isBluetoothEnabled() { return isBluetoothEnabled(BluetoothAdapter.getDefaultAdapter()); } @Override boolean isConnecting(TGDevice device); @Override boolean isConnected(TGDevice device); @Override boolean canConnect(TGDevice device); @Override bo... | DefaultPreconditions implements Preconditions { @Override public boolean isBluetoothEnabled() { return isBluetoothEnabled(BluetoothAdapter.getDefaultAdapter()); } @Override boolean isConnecting(TGDevice device); @Override boolean isConnected(TGDevice device); @Override boolean canConnect(TGDevice device); @Override bo... |
@Test public void bluetoothShouldNotBeEnabled() { when(bluetoothAdapter.isEnabled()).thenReturn(false); boolean isEnabled = preconditions.isBluetoothEnabled(bluetoothAdapter); assertThat(isEnabled).isFalse(); } | @Override public boolean isBluetoothEnabled() { return isBluetoothEnabled(BluetoothAdapter.getDefaultAdapter()); } | DefaultPreconditions implements Preconditions { @Override public boolean isBluetoothEnabled() { return isBluetoothEnabled(BluetoothAdapter.getDefaultAdapter()); } } | DefaultPreconditions implements Preconditions { @Override public boolean isBluetoothEnabled() { return isBluetoothEnabled(BluetoothAdapter.getDefaultAdapter()); } } | DefaultPreconditions implements Preconditions { @Override public boolean isBluetoothEnabled() { return isBluetoothEnabled(BluetoothAdapter.getDefaultAdapter()); } @Override boolean isConnecting(TGDevice device); @Override boolean isConnected(TGDevice device); @Override boolean canConnect(TGDevice device); @Override bo... | DefaultPreconditions implements Preconditions { @Override public boolean isBluetoothEnabled() { return isBluetoothEnabled(BluetoothAdapter.getDefaultAdapter()); } @Override boolean isConnecting(TGDevice device); @Override boolean isConnected(TGDevice device); @Override boolean canConnect(TGDevice device); @Override bo... |
@Test public void bluetoothShouldNotBeEnabledWhenAdapterIsNull() { boolean isEnabled = preconditions.isBluetoothEnabled(null); assertThat(isEnabled).isFalse(); } | @Override public boolean isBluetoothEnabled() { return isBluetoothEnabled(BluetoothAdapter.getDefaultAdapter()); } | DefaultPreconditions implements Preconditions { @Override public boolean isBluetoothEnabled() { return isBluetoothEnabled(BluetoothAdapter.getDefaultAdapter()); } } | DefaultPreconditions implements Preconditions { @Override public boolean isBluetoothEnabled() { return isBluetoothEnabled(BluetoothAdapter.getDefaultAdapter()); } } | DefaultPreconditions implements Preconditions { @Override public boolean isBluetoothEnabled() { return isBluetoothEnabled(BluetoothAdapter.getDefaultAdapter()); } @Override boolean isConnecting(TGDevice device); @Override boolean isConnected(TGDevice device); @Override boolean canConnect(TGDevice device); @Override bo... | DefaultPreconditions implements Preconditions { @Override public boolean isBluetoothEnabled() { return isBluetoothEnabled(BluetoothAdapter.getDefaultAdapter()); } @Override boolean isConnecting(TGDevice device); @Override boolean isConnected(TGDevice device); @Override boolean canConnect(TGDevice device); @Override bo... |
@Test(expected = BluetoothNotEnabledException.class) public void shouldThrowAnExceptionWhenTryingToConnectToDeviceWithBluetoothDisabled() { NeuroSky neuroSky = new NeuroSky(deviceMessageListener); neuroSky.connect(); } | public void connect() throws BluetoothNotEnabledException { if (!preconditions.isBluetoothEnabled()) { throw new BluetoothNotEnabledException(); } if (canConnect()) { openConnection(); } } | NeuroSky { public void connect() throws BluetoothNotEnabledException { if (!preconditions.isBluetoothEnabled()) { throw new BluetoothNotEnabledException(); } if (canConnect()) { openConnection(); } } } | NeuroSky { public void connect() throws BluetoothNotEnabledException { if (!preconditions.isBluetoothEnabled()) { throw new BluetoothNotEnabledException(); } if (canConnect()) { openConnection(); } } NeuroSky(final DeviceMessageListener listener); protected NeuroSky(final DeviceMessageListener listener, @NonNull Preco... | NeuroSky { public void connect() throws BluetoothNotEnabledException { if (!preconditions.isBluetoothEnabled()) { throw new BluetoothNotEnabledException(); } if (canConnect()) { openConnection(); } } NeuroSky(final DeviceMessageListener listener); protected NeuroSky(final DeviceMessageListener listener, @NonNull Preco... | NeuroSky { public void connect() throws BluetoothNotEnabledException { if (!preconditions.isBluetoothEnabled()) { throw new BluetoothNotEnabledException(); } if (canConnect()) { openConnection(); } } NeuroSky(final DeviceMessageListener listener); protected NeuroSky(final DeviceMessageListener listener, @NonNull Preco... |
@Test public void shouldHandleMessage() { DeviceMessageHandler handler = new DeviceMessageHandler(deviceMessageListener); handler.handleMessage(message); verify(deviceMessageListener).onMessageReceived(message); } | @Override public void handleMessage(Message message) { super.handleMessage(message); if (listener != null) { listener.onMessageReceived(message); } } | DeviceMessageHandler extends Handler { @Override public void handleMessage(Message message) { super.handleMessage(message); if (listener != null) { listener.onMessageReceived(message); } } } | DeviceMessageHandler extends Handler { @Override public void handleMessage(Message message) { super.handleMessage(message); if (listener != null) { listener.onMessageReceived(message); } } DeviceMessageHandler(final DeviceMessageListener deviceMessageListener); } | DeviceMessageHandler extends Handler { @Override public void handleMessage(Message message) { super.handleMessage(message); if (listener != null) { listener.onMessageReceived(message); } } DeviceMessageHandler(final DeviceMessageListener deviceMessageListener); @Override void handleMessage(Message message); } | DeviceMessageHandler extends Handler { @Override public void handleMessage(Message message) { super.handleMessage(message); if (listener != null) { listener.onMessageReceived(message); } } DeviceMessageHandler(final DeviceMessageListener deviceMessageListener); @Override void handleMessage(Message message); } |
@Test public void shouldNotHandleMessage() { DeviceMessageHandler handler = new DeviceMessageHandler(null); handler.handleMessage(message); verify(deviceMessageListener, times(0)).onMessageReceived(message); } | @Override public void handleMessage(Message message) { super.handleMessage(message); if (listener != null) { listener.onMessageReceived(message); } } | DeviceMessageHandler extends Handler { @Override public void handleMessage(Message message) { super.handleMessage(message); if (listener != null) { listener.onMessageReceived(message); } } } | DeviceMessageHandler extends Handler { @Override public void handleMessage(Message message) { super.handleMessage(message); if (listener != null) { listener.onMessageReceived(message); } } DeviceMessageHandler(final DeviceMessageListener deviceMessageListener); } | DeviceMessageHandler extends Handler { @Override public void handleMessage(Message message) { super.handleMessage(message); if (listener != null) { listener.onMessageReceived(message); } } DeviceMessageHandler(final DeviceMessageListener deviceMessageListener); @Override void handleMessage(Message message); } | DeviceMessageHandler extends Handler { @Override public void handleMessage(Message message) { super.handleMessage(message); if (listener != null) { listener.onMessageReceived(message); } } DeviceMessageHandler(final DeviceMessageListener deviceMessageListener); @Override void handleMessage(Message message); } |
@Test public void shouldCreateBus() { EventBus bus = EventBus.create(); assertThat(bus).isNotNull(); } | public static EventBus create() { return new EventBus(); } | EventBus { public static EventBus create() { return new EventBus(); } } | EventBus { public static EventBus create() { return new EventBus(); } private EventBus(); } | EventBus { public static EventBus create() { return new EventBus(); } private EventBus(); static EventBus create(); void send(final BrainEvent object); @SuppressWarnings("unchecked") Flowable<BrainEvent> receive(BackpressureStrategy backpressureStrategy); } | EventBus { public static EventBus create() { return new EventBus(); } private EventBus(); static EventBus create(); void send(final BrainEvent object); @SuppressWarnings("unchecked") Flowable<BrainEvent> receive(BackpressureStrategy backpressureStrategy); } |
@Test public void shouldThrowAnErrorWhenTryingToConnectToDeviceWithBluetoothDisabled() { RxNeuroSky neuroSky = new RxNeuroSky(); Throwable throwable = neuroSky.connect().blockingGet(); assertThat(throwable).isInstanceOf(BluetoothNotEnabledException.class); assertThat(throwable.getMessage()).isEqualTo(new BluetoothNotEn... | public Completable connect() { return Completable.create(emitter -> { if (!preconditions.isBluetoothEnabled()) { emitter.onError(new BluetoothNotEnabledException()); } if (preconditions.canConnect(device)) { openConnection(); emitter.onComplete(); } else { emitter.onError(new BluetoothConnectingOrConnectedException());... | RxNeuroSky { public Completable connect() { return Completable.create(emitter -> { if (!preconditions.isBluetoothEnabled()) { emitter.onError(new BluetoothNotEnabledException()); } if (preconditions.canConnect(device)) { openConnection(); emitter.onComplete(); } else { emitter.onError(new BluetoothConnectingOrConnected... | RxNeuroSky { public Completable connect() { return Completable.create(emitter -> { if (!preconditions.isBluetoothEnabled()) { emitter.onError(new BluetoothNotEnabledException()); } if (preconditions.canConnect(device)) { openConnection(); emitter.onComplete(); } else { emitter.onError(new BluetoothConnectingOrConnected... | RxNeuroSky { public Completable connect() { return Completable.create(emitter -> { if (!preconditions.isBluetoothEnabled()) { emitter.onError(new BluetoothNotEnabledException()); } if (preconditions.canConnect(device)) { openConnection(); emitter.onComplete(); } else { emitter.onError(new BluetoothConnectingOrConnected... | RxNeuroSky { public Completable connect() { return Completable.create(emitter -> { if (!preconditions.isBluetoothEnabled()) { emitter.onError(new BluetoothNotEnabledException()); } if (preconditions.canConnect(device)) { openConnection(); emitter.onComplete(); } else { emitter.onError(new BluetoothConnectingOrConnected... |
@Test public void shouldNotBeConnecting() { when(tgDevice.getState()).thenReturn(TGDevice.STATE_DISCONNECTED); boolean isConnecting = preconditions.isConnecting(tgDevice); assertThat(isConnecting).isFalse(); } | @Override public boolean isConnecting(TGDevice device) { return device != null && device.getState() == TGDevice.STATE_CONNECTING; } | DefaultPreconditions implements Preconditions { @Override public boolean isConnecting(TGDevice device) { return device != null && device.getState() == TGDevice.STATE_CONNECTING; } } | DefaultPreconditions implements Preconditions { @Override public boolean isConnecting(TGDevice device) { return device != null && device.getState() == TGDevice.STATE_CONNECTING; } } | DefaultPreconditions implements Preconditions { @Override public boolean isConnecting(TGDevice device) { return device != null && device.getState() == TGDevice.STATE_CONNECTING; } @Override boolean isConnecting(TGDevice device); @Override boolean isConnected(TGDevice device); @Override boolean canConnect(TGDevice devi... | DefaultPreconditions implements Preconditions { @Override public boolean isConnecting(TGDevice device) { return device != null && device.getState() == TGDevice.STATE_CONNECTING; } @Override boolean isConnecting(TGDevice device); @Override boolean isConnected(TGDevice device); @Override boolean canConnect(TGDevice devi... |
@Test public void shouldNotBeConnectingWhenDeviceIsNull() { boolean isConnecting = preconditions.isConnecting(null); assertThat(isConnecting).isFalse(); } | @Override public boolean isConnecting(TGDevice device) { return device != null && device.getState() == TGDevice.STATE_CONNECTING; } | DefaultPreconditions implements Preconditions { @Override public boolean isConnecting(TGDevice device) { return device != null && device.getState() == TGDevice.STATE_CONNECTING; } } | DefaultPreconditions implements Preconditions { @Override public boolean isConnecting(TGDevice device) { return device != null && device.getState() == TGDevice.STATE_CONNECTING; } } | DefaultPreconditions implements Preconditions { @Override public boolean isConnecting(TGDevice device) { return device != null && device.getState() == TGDevice.STATE_CONNECTING; } @Override boolean isConnecting(TGDevice device); @Override boolean isConnected(TGDevice device); @Override boolean canConnect(TGDevice devi... | DefaultPreconditions implements Preconditions { @Override public boolean isConnecting(TGDevice device) { return device != null && device.getState() == TGDevice.STATE_CONNECTING; } @Override boolean isConnecting(TGDevice device); @Override boolean isConnected(TGDevice device); @Override boolean canConnect(TGDevice devi... |
@Test public void shouldBeConnected() { when(tgDevice.getState()).thenReturn(TGDevice.STATE_CONNECTED); boolean isConnected = preconditions.isConnected(tgDevice); assertThat(isConnected).isTrue(); } | @Override public boolean isConnected(TGDevice device) { return device != null && device.getState() == TGDevice.STATE_CONNECTED; } | DefaultPreconditions implements Preconditions { @Override public boolean isConnected(TGDevice device) { return device != null && device.getState() == TGDevice.STATE_CONNECTED; } } | DefaultPreconditions implements Preconditions { @Override public boolean isConnected(TGDevice device) { return device != null && device.getState() == TGDevice.STATE_CONNECTED; } } | DefaultPreconditions implements Preconditions { @Override public boolean isConnected(TGDevice device) { return device != null && device.getState() == TGDevice.STATE_CONNECTED; } @Override boolean isConnecting(TGDevice device); @Override boolean isConnected(TGDevice device); @Override boolean canConnect(TGDevice device... | DefaultPreconditions implements Preconditions { @Override public boolean isConnected(TGDevice device) { return device != null && device.getState() == TGDevice.STATE_CONNECTED; } @Override boolean isConnecting(TGDevice device); @Override boolean isConnected(TGDevice device); @Override boolean canConnect(TGDevice device... |
@Test public void shouldNotBeConnected() { when(tgDevice.getState()).thenReturn(TGDevice.STATE_DISCONNECTED); boolean isConnected = preconditions.isConnected(tgDevice); assertThat(isConnected).isFalse(); } | @Override public boolean isConnected(TGDevice device) { return device != null && device.getState() == TGDevice.STATE_CONNECTED; } | DefaultPreconditions implements Preconditions { @Override public boolean isConnected(TGDevice device) { return device != null && device.getState() == TGDevice.STATE_CONNECTED; } } | DefaultPreconditions implements Preconditions { @Override public boolean isConnected(TGDevice device) { return device != null && device.getState() == TGDevice.STATE_CONNECTED; } } | DefaultPreconditions implements Preconditions { @Override public boolean isConnected(TGDevice device) { return device != null && device.getState() == TGDevice.STATE_CONNECTED; } @Override boolean isConnecting(TGDevice device); @Override boolean isConnected(TGDevice device); @Override boolean canConnect(TGDevice device... | DefaultPreconditions implements Preconditions { @Override public boolean isConnected(TGDevice device) { return device != null && device.getState() == TGDevice.STATE_CONNECTED; } @Override boolean isConnecting(TGDevice device); @Override boolean isConnected(TGDevice device); @Override boolean canConnect(TGDevice device... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.