Commit 2553a6bb authored by Krish Shah's avatar Krish Shah
Browse files

attempted to resolve issue #4

parent dde7c208
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
package com.example.a8_bitinvader;

class TestPositive {
   <T extends Number> boolean amIPositive(T num) {

      return (num.doubleValue() > 0);
   }
}
+0 −15
Original line number Diff line number Diff line
@@ -12,21 +12,6 @@ import static org.junit.Assert.*;
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
public class ExampleUnitTest {
    /**
     *
     * @param num A number of type T
     * @return true iff num is greater than 0
     * @param <T> A type that extends Number
     */
    <T extends Number> boolean amIPositive(T num) {
        return (num.doubleValue() > 0);
    }

    @Test
    public void addition_isCorrect() {
        assertEquals(4, 2 + 2);
    }

    @Test
    public void testAmIPositive() {
        assertTrue(amIPositive(0.3));