@Test public void testIsEqualOrGreaterThan() { assertFalse(new LineAppVersion(1, 1, 1).isEqualOrGreaterThan(null)); assertTrue(new LineAppVersion(1, 1, 1).isEqualOrGreaterThan(new LineAppVersion(0, 1, 1))); assertTrue(new LineAppVersion(1, 1, 1).isEqualOrGreaterThan(new LineAppVersion(1, 0, 1))); assertTrue(new LineAppVersion(1, 1, 1).isEqualOrGreaterThan(new LineAppVersion(1, 1, 0))); assertTrue(new LineAppVersion(1, 1, 1).isEqualOrGreaterThan(new LineAppVersion(1, 1, 1))); assertFalse(new LineAppVersion(1, 1, 1).isEqualOrGreaterThan(new LineAppVersion(2, 1, 1))); assertFalse(new LineAppVersion(1, 1, 1).isEqualOrGreaterThan(new LineAppVersion(1, 2, 1))); assertFalse(new LineAppVersion(1, 1, 1).isEqualOrGreaterThan(new LineAppVersion(1, 1, 2))); }
public boolean isEqualOrGreaterThan(@Nullable LineAppVersion another) { if (another == null) { return false; } if (major != another.major) { return major >= another.major; } if (minor != another.minor) { return minor >= another.minor; } return revision >= another.revision; }
LineAppVersion { public boolean isEqualOrGreaterThan(@Nullable LineAppVersion another) { if (another == null) { return false; } if (major != another.major) { return major >= another.major; } if (minor != another.minor) { return minor >= another.minor; } return revision >= another.revision; } }
LineAppVersion { public boolean isEqualOrGreaterThan(@Nullable LineAppVersion another) { if (another == null) { return false; } if (major != another.major) { return major >= another.major; } if (minor != another.minor) { return minor >= another.minor; } return revision >= another.revision; } LineAppVersion(int major, int minor, int revision); }
LineAppVersion { public boolean isEqualOrGreaterThan(@Nullable LineAppVersion another) { if (another == null) { return false; } if (major != another.major) { return major >= another.major; } if (minor != another.minor) { return minor >= another.minor; } return revision >= another.revision; } LineAppVersion(int major, int minor, int revision); @Nullable static LineAppVersion getLineAppVersion(@NonNull Context context); int getMajor(); int getMinor(); int getRevision(); boolean isEqualOrGreaterThan(@Nullable LineAppVersion another); @Override boolean equals(Object o); @Override int hashCode(); }
LineAppVersion { public boolean isEqualOrGreaterThan(@Nullable LineAppVersion another) { if (another == null) { return false; } if (major != another.major) { return major >= another.major; } if (minor != another.minor) { return minor >= another.minor; } return revision >= another.revision; } LineAppVersion(int major, int minor, int revision); @Nullable static LineAppVersion getLineAppVersion(@NonNull Context context); int getMajor(); int getMinor(); int getRevision(); boolean isEqualOrGreaterThan(@Nullable LineAppVersion another); @Override boolean equals(Object o); @Override int hashCode();  }